You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that while application/json;charset=UTF-8 is accepted by most services it is not correct per the spec... RFC 8259 - The JavaScript Object Notation (JSON) Data Interchange Format because (AFAIK) all json must be UTF-8. My hunch is that most services just ignore the charset parameter. But, some services will complain about an unsupported content type
So I have a few options:
Convince service owners to always accept application/json;charset=UTF-8 as valid
Update core-client-rest to emit application/json without the charset
Handle this in the convenience layer
a custom pipeline policy
This issue tracks the final resolution and code changes. A workaround for KeyVault involves a custom policy
The text was updated successfully, but these errors were encountered:
maorleger
changed the title
[core-client-rest] Content-Type for JSON should be application/json
[core] [core-client-rest] Content-Type for JSON should be application/json
Nov 19, 2024
looks like core-client-rest uses application/json;charset=UTF-8 but core-client / autorest based mappers default to "application/json"
core-client-rest: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client-rest/src/sendRequest.ts#L100-L107
keyvault-secrets: azure-sdk-for-js/sdk/keyvault/keyvault-secrets/src/generated/models/parameters.ts at main · maorleger/azure-sdk-for-js
The problem is that while application/json;charset=UTF-8 is accepted by most services it is not correct per the spec... RFC 8259 - The JavaScript Object Notation (JSON) Data Interchange Format because (AFAIK) all json must be UTF-8. My hunch is that most services just ignore the charset parameter. But, some services will complain about an unsupported content type
So I have a few options:
This issue tracks the final resolution and code changes. A workaround for KeyVault involves a custom policy
The text was updated successfully, but these errors were encountered: