on 11-02-2022 7:38 PM
Hi
I am consuming an external API Post method to send PO information from our ECC system on release 731, SP14.
We are able to send Po data in Json format without any issues until we found an issue. Here content type is set to "application/problem+json; charset=utf-8".
Issue is, few material descriptions has special character (non breaking space) because of that receiver is not able to receive our data and their .NET system is rejecting that.
Even though I am able to fix it, we have other fields in the Po data where special characters can appear. Ex - Vendor name, address.
To over come that, we decided to send the data in Base64 encoded format and content type set to "text/plain".
But when I push the data, I am getting error 415 - Unsupported media type.
Initially when i was using "application/json" i faced the same issue but later after adding the addition it worked - "application/problem+json; charset=utf-8".
Similarly for "text/plain" also i am facing issue but not sure what is the addition i need to use. I have tried "text/plain; charset=utf-8" but its not working.
Any suggestions, please let me know.
The error 415 - Unsupported Media Type occurs when the server is unable to process the media type of the data sent by the client. In your case, it seems that the server is not able to process the "text/plain" content type that you are sending.
One possible reason for this error could be that the server is expecting a specific media type, such as "application/json" or "application/xml", and is not configured to handle "text/plain". You may need to check the API documentation or contact the API provider to confirm the supported media types.
Another possible reason could be that the content of the data being sent is not properly formatted for the selected media type. In your case, if you are sending Base64-encoded data in "text/plain" format, you may need to ensure that the data is properly encoded and formatted for the media type.
You could also try specifying the character set as part of the media type, such as "text/plain; charset=utf-8", to see if that resolves the issue. If that doesn't work, you may need to try a different media type that is supported by the server.
Lastly, it's worth noting that some APIs may have strict requirements for the format and encoding of data being sent, so you may need to ensure that your data conforms to those requirements.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
11 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.