Why I got "errorcode":"protocol.http.ResponseWithBody" if the response has no body?

Hi,

I have the following problem. I have a FuseESB as target endpoint of one of my proxy. When I make a call to the Fuse webservice directly everything works fine and the response is:

HTTP/1.1 204 No Content Date: Wed, 19 Oct 2016 08:01:04 GMT Server: Jetty(8.1.17.v20150415) Transfer-Encoding: chunked Content-Length: 0 Keep-Alive: timeout=2, max=256 Connection: Keep-Alive Content-Type: text/plain; charset=UTF-8

When I call the webservice through the apigee proxy, it blocks that answer and respond back:

HTTP/1.1 502 Bad Gateway Content-Type: application/json Date: Wed, 19 Oct 2016 08:02:02 GMT Server: Apigee Router Content-Length: 123 Connection: keep-alive {"fault":{"faultstring":"Received 204 Response with message body","detail":{"errorcode":"protocol.http.ResponseWithBody"}}}

It seems that the proxy see a body in the response, but there is no body actually. Anyone can help to solve?

0 4 684
4 REPLIES 4

Kindly ensure -

1. if your proxy is trying to manipulate the response from back-end, in which case it might raise a fault, having not found the response.

OR

2. if your proxy raises a fault implicitly for no response from the backend.

Apigee Trace Tool will help you figure out what is certainly going wrong in the transaction.

Hi ,thanks for your reply.

1- I've tried to disable all the manipulation on the response but I have the same problem.

2- I've used the trace tool but I am still not able to figure out what is the problem.


So it sounds like a bug on Apigee :

The response is a 204 NoContent (with no body) and with following header:

Transfer-Encoding: chunked

Content-Length: 0

Keep-Alive: timeout=2, max=256

Connection: Keep-Alive

Content-Type: text/plain; charset=UTF-8

It contains no body, but the proxy raise an error because a 204 code must not have a body ... so, as far as I understand, the claim of the proxy is wrong....Do we have a defect here?

Not applicable

@fabiobortoli

Do you have any update on that, As I am also getting the same response from backend for 204 status code.

Hi All,

I tried adding this in the Assign message policy and it works.

<Remove> <Headers> <Header name="Accept-Encoding"/> </Headers> </Remove>

The detailed information you can find it in the below link on how the servers works.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding