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 }
Hi
I don't have the answer for you but I might be able to provide some clues.
You are showing the response as a JSON payload. Where is that coming from ? How are you invoking the endpoint, and how do you get those payloads? Normally the response code is not embedded into a JSON payload , but is sent at the beginning of the HTTP response. I am more accustomed to seeing the response formatted this way:
HTTP/1.1 200 OK Date: Thu, 15 Feb 2018 20:27:57 GMT Content-Type: application/json Content-Length: 225 Connection: keep-alive { "timed_out": false, "_shards": { "total": 12, "successful": 12, "failed": 0 }, "hits": { "total": 0, "max_score": null, "hits": [] }, "stamp": "reformatted at 2018-02-15T20:27:57.425Z" }
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |