Response: "Unsupported content type" while calling from frontend (client.request)

Hi,

Getting response as “Unsupported content type” while making a request using client.request in my frontend code. The body and header values are exactly same as it is being used in postman where m getting the desired result.

Following is the response, getting in browser through app code;

{
  "status": 415,
  "headers": {},
  "response": "Unsupported content type",
  "errorSource": "APP",
  "attempts": 1
}

‘Content-Type’: ‘application/json’ has been passed in request.
Note: Gone through similar topics in this forum, but, not got exact solution.

Hi @amir.iqba,

The “Content-Type” that you may pass is for the request body content type.
In the APIs response in Postman, what is the content type received? Are you also passing the “Accept” header with a particular content type?

1 Like

In postman, I’m getting ‘application/java; charset=UTF-8’ as Content-Type in response. As, it is expected to come as ‘application/json; charset=UTF-8’.
Also, I’m not passing accept header in my code. However, I’ve tested after giving accept as ‘application/json’.

Hi @amir.iqba,

The “application/java” is not one of the supported Content-Type in our platform’s Request Method.

To validate the API, could you provide the following information?

  1. Is it a self-hosted API service?
  2. If it’s a self-hosted API service, would you be able to convert to one of the supported content types such as application/json, text/xml?
  3. If not your own API service, could you point us to the documentation of this API?

Thank you!