Amazon does not specifically document what application/x-amz-json
Content-Type is for, however there are protocol documentations on Smithy (an open source language for defining services and SDKs published by AWS):
Considering the question relates to the difference when used as Content-Type
1 header to make requests, I think we can tell the difference is:
application/json
is to request/receive JSON data without anything more specific
application/x-amz-json-1.1
(or other version) is also to request/receive JSON data and expect additional behaviors described in the docs above. (i.e. tell the server/client this is JSON plus additional elements)
I think application/x-amz-json
can be thought as a sort of extension or a more specific way of doing application/json
requests.
it became a problem that an API Gateway I was communicating with didn't like handling it (for whatever reason)
In the specific case of making PATCH, PUT and POST requests to AWS Amazon API Gateway, specifying Content-Type
header application/x-amz-json-1.1
or other version seems to be required. As per related docs:
Content-Type (Conditional)
Specifies JSON and the version, for example, Content-Type: application/x-amz-json-1.0.
Condition: Required for PATCH, PUT and POST requests.
Maybe the server understands application/json
as basic JSON but requires application/x-amz-json-1.1
to perform specific requests.
1 Content-Tye
header being used to tell the server/client how to process our request