Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Content-Type Header

ANSWERED

I am having trouble retrieving token state using cURL in PHP.

I am submitting headers:

Authorization: Bearer <Access Token>

Content-Type: application/x-www-form-urlencoded

 

 The response is: 

"The [Content-Type: application/x-www-form-urlencoded] header is required by this endpoint."

 

Output of curl_getinfo($ch, CURLINFO_HEADER_OUT) is:

POST /oauth2/introspect HTTP/1.1
Host: api.fitbit.com
Accept: */*
Authorization: Bearer <Access Token>
Content-Length: 393
Expect: 100-continue
Content-Type: application/x-www-form-urlencoded; boundary=------------------------4ea27c362eabb08c

 

I am at a total loss here, I AM sending the Content-Type header but the API is not recognizing it.

I have successfully requested and gotten a token from authorization code using the same Content-Type header.

 

Everything indicates that I am sending the appropriate headers but the API is not recognizing them.

 

Any help would be greatly appreciated.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@DonDickinson , the response that you're getting says that the header should look like

"Content-Type: application/x-www-form-urlencoded".

 I see based on your output your Content-Type header looks different and it has extra data at the end.

Try to remove this extra piece at the end " boundary=------------------------4ea27c362eabb08c" 

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

@DonDickinson , the response that you're getting says that the header should look like

"Content-Type: application/x-www-form-urlencoded".

 I see based on your output your Content-Type header looks different and it has extra data at the end.

Try to remove this extra piece at the end " boundary=------------------------4ea27c362eabb08c" 

Best Answer
0 Votes