B4J Question HTTPJOB.PutString and HttpMediaTypeNotSupportedException

lancaster

Member
Licensed User
I am attempting to make a PUT request to a REST API setting the headers of Content-Type:application/json and Accept:application/json and of course passing a valid json string in the body of the request.

The remote service returns "HttpMediaTypeNotSupportedException" "Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported" where clearly this is not the content-type I am specifying in the header.

Ironically I can use POSTMAN with exactly the same headers and json payload and the remote service accepts the request.

This suggests to me that the HTTP client stack is inserting an alternative Content-Type header.

Has anyone encountered similar? Thanks
 
Top