Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

HTTP 415 - Unsupported Media Type with proper content type

Not applicable

Hi everyone!

Apigee is sending 415 response for any POST request, and I'm having hard time to debug what is going wrong. I'm passing Content-Type: application/json as suggested in related question, but it doesn't make any difference. In the same time, if I set content type to multipart-form, Apigee consider it as valid request, but body of that request becomes empty.

Is there a way to get some insights why it is happening?

What Apigee consider as supported content type?

Is there a way to tell Apigee which content type is correct?

Sample of my request:

{
  "method": "POST",
  "url": "https://<host>/v1/auth",
  "headers": {
    "ApiKey": "<apikey>",
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  "data": "{\"accountId\": 1}"
}
Sample of response:
{
  "pragma": "no-cache",
  "date": "Wed, 14 Feb 2018 15:15:11 GMT",
  "cache-control": "no-cache",
  "connection": "close",
  "content-length": "18",
  "content-type": "text/plain",
  "status": 415
}
0 1 18.9K
1 REPLY 1