Skip to main content
deleted 163 characters in body
Source Link

I'm getting the following response body and header from https://stackoverflow.com/oauth/access_token when attempting to exchange an oauth code for a token:

<DEBUG> [00:30:03] my-app - content-type: text/plain; charset=utf-8
<DEBUG> [00:30:03] my-app - response: access_token=<redacted>&expires=86400

I'm writing an oauth2 client not specific to stack exchange and I'm not sure how to handle this kind of response in a generic way, since it's neither JSON, nor does the content-type give me any useful indication on how to interpret the content without looking at the content itself.

Should the content type be x-www-form-urlencoded?

If not, what prevents the API from changing the response format to some other random text format? Like:

access_token:<redacted>;expires:<expiration>

I'm getting the following response body and header from https://stackoverflow.com/oauth/access_token when attempting to exchange an oauth code for a token:

<DEBUG> [00:30:03] my-app - content-type: text/plain; charset=utf-8
<DEBUG> [00:30:03] my-app - response: access_token=<redacted>&expires=86400

I'm writing an oauth2 client not specific to stack exchange and I'm not sure how to handle this kind of response in a generic way, since it's neither JSON, nor does the content-type give me any useful indication on how to interpret the content without looking at the content itself.

Should the content type be x-www-form-urlencoded?

If not, what prevents the API from changing the response format to some other random text format? Like:

access_token:<redacted>;expires:<expiration>

I'm getting the following response body and header from https://stackoverflow.com/oauth/access_token when attempting to exchange an oauth code for a token:

<DEBUG> [00:30:03] my-app - content-type: text/plain; charset=utf-8
<DEBUG> [00:30:03] my-app - response: access_token=<redacted>&expires=86400

I'm writing an oauth2 client not specific to stack exchange and I'm not sure how to handle this kind of response in a generic way, since it's neither JSON, nor does the content-type give me any useful indication on how to interpret the content without looking at the content itself.

Should the content type be x-www-form-urlencoded?

See the linked duplicate.
Link
Brock Adams
  • 13k
  • 5
  • 39
  • 64
edited tags
Source Link

I'm getting the following response body and header from https://stackoverflow.com/oauth/access_token when attempting to exchange an oauth code for a token:

<DEBUG> [00:30:03] my-app - content-type: text/plain; charset=utf-8
<DEBUG> [00:30:03] my-app - response: access_token=<redacted>&expires=86400

I'm writing an oauth2 client not specific to stack exchange and I'm not sure how to handle this kind of response in a generic way, since it's neither JSON, nor does the content-type give me any useful indication on how to interpret the content without looking at the content itself.

Should the content type be x-www-form-urlencoded?

If not, what prevents the API from changing the response format to some other random text format? Like:

access_token:<redacted>;expires:<expiration>

I'm getting the following response body and header from https://stackoverflow.com/oauth/access_token when attempting to exchange an oauth code for a token:

<DEBUG> [00:30:03] my-app - content-type: text/plain; charset=utf-8
<DEBUG> [00:30:03] my-app - response: access_token=<redacted>&expires=86400

I'm writing an oauth2 client not specific to stack exchange and I'm not sure how to handle this kind of response in a generic way.

Should the content type be x-www-form-urlencoded?

I'm getting the following response body and header from https://stackoverflow.com/oauth/access_token when attempting to exchange an oauth code for a token:

<DEBUG> [00:30:03] my-app - content-type: text/plain; charset=utf-8
<DEBUG> [00:30:03] my-app - response: access_token=<redacted>&expires=86400

I'm writing an oauth2 client not specific to stack exchange and I'm not sure how to handle this kind of response in a generic way, since it's neither JSON, nor does the content-type give me any useful indication on how to interpret the content without looking at the content itself.

Should the content type be x-www-form-urlencoded?

If not, what prevents the API from changing the response format to some other random text format? Like:

access_token:<redacted>;expires:<expiration>
edited tags
Source Link
Loading
edited tags
Link
Brock Adams
  • 13k
  • 5
  • 39
  • 64
Loading
Source Link
Loading