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
Post a Comment