Charset=utf-8 added in Content-type but not accepted

Hi,

I have an SAP endpoint which requires application/merge-patch+json as Content type for a PATCH.

It seems EM is automatically adding ; charset=utf-8 after it in the request header, making the query failed. SAP seems to be strictly matching the header value.

I've tried in Postman with and without the charset. It works without. Same error than with EM with.

{
"error": {
"message": "The header value is invalid. For the HTTP method ‘PATCH’, use: application/merge-patch+json.",
"target": "{content-type}"
}
}

Is there a way to avoid having that charset piece been added in the content type ?

Thanks

Olivier

Hi @oripert

EasyMorph is built on the .NET platform, which (following RFC 7231 standards) explicitly appends charset=utf-8 to text-based payloads to ensure data integrity. The "Specify charset" checkbox currently controls which encoding is used, but the underlying framework defaults to being explicit.

There is a workaround you can use in EasyMorph to avoid the charset=utf-8 being appended to the Content-Type header.

  • Generate your JSON payload and save it to a temporary file.
  • In the Web Request action, set the Body type to File and use that file as the request body.
  • Manually add the Content-Type header with the exact value required by SAP: application/merge-patch+json.

With the File body type, EasyMorph will not append the additional charset parameter to the manually specified header.

Another possible workaround is using the CURL utility via the Run Program action.

In the meantime, we are looking into what could be changed here to make this behavior more convenient.

Hi @serhii ,

Thanks for the workaround. It worked perfectly !

Just need to remove about 44k files now :sweat_smile: