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>