web services - Setting up angular2 typescript Headers giving 401 error -


i created http request following headers , options:

let theheaders = new headers({ 'content-type': 'application/json' });  // ... set content type json theheaders.append('withcredentials','true'); theheaders.append("access-control-allow-credentials", "true"); theheaders.append('authorization', 'token token 1b05af30e860c0aeb9577312ced54ba6d84a59cd');                         let theoptions = new requestoptions({ headers: theheaders }) // create request option         return this._http.get(this.makeurl, theoptions) 

i got 401 error.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -