`refreshTokens` failing because Content-Type defined twice in API request
See original GitHub issueWhen using refreshTokens
I get the following response back from Hue after debugging:
HttpError: HTTP error status: 400; {"fault":{"faultstring":"Duplicate Header \"content-type\"","detail":{"errorcode":"protocol.http.DuplicateHeader"}}}
These are the headers that are sent:
{
baseURL: 'https://api.meethue.com',
headers: {
Accept: 'application/json',
'content-type': 'application/x-www-form-urlencoded',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
responseType: 'json'
}
This is in the config
variable below:

At some point 2 content-type
headers are inserted, I’m assuming if it only uses one the API call will start working.
Anyone else getting this issue?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Angular 4 Interceptor retry requests after token refresh
Works with parallel requests. UPDATE: The code updated with Angular 9 / RxJS 6, error handling and fix looping when refreshToken fails
Read more >Refresh Tokens - OAuth 2.0 Simplified
Some people like to get a new access token shortly before the current one will expire in order to save an HTTP request...
Read more >Re: Refresh token lifetime, error AADSTS50076 - Page 2
After the refresh token failed to give us valid access tokens every 24 hours for three days, we found this highlighted checkbox. We...
Read more >Enable OAuth Refresh Tokens in AngularJS App using ASP ...
Detailed post with live example about enabling OAuth Refresh Tokens in AngularJS application using ASP.NET Web API, Owin middle-ware and ...
Read more >Tickets (V2 Beta) | API Documentation
If you are unaware of how to obtain an authorization token, refer to Requesting Access and Refresh tokens under the Getting Access Token...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you for the feedback, there is a change to the returned payload that I have now captured and fixed, but will hold back on releasing util next week as I have other code changes in flight that I need to complete first.
Thanks @peter-murray, sounds great!