For and XML response the header should be Content-type: text/xml
Generally all you need to do is pass format to the render block, or use respond_with. Alternatively, you should be able to pass content_type as a parameter to the render block.
But perhaps you meant you want to remove all the headers from the response? This is kind of a nonsense request, since HTTP servers by definition uses header to talk to one another.
That’s basically like asking to have a phone call with someone but not have the phone company use satellites or copper wires during the conversion.
What client-side application could you possibly be using to accept responses without any HTTP headers at all ?
Since it goes on to say (in 4.3) "The presence of a message-body in a
request is signaled by the inclusion of a Content-Length or
Transfer-Encoding header field in the request's message-headers" does
that not imply that if there is are no headers then there can be no
body either? I think the OP was looking for a body with no headers.
Not to be confused with a headless body which would be quite
different.
He gets that snippet from another server, the opening does not want to create a body without headers, he wants to extract the actual body out of a full HTTP-response he got from external services.
So easiest way would be to drop everything before the first (and including it) newline, the remainder is the body, as described in the HTTP-RFC…
He gets that snippet from another server, the opening does not want to
create a body without headers, he wants to extract the actual body out
of a
full HTTP-response he got from external services.
So easiest way would be to drop everything before the first (and
including
it) newline, the remainder is the body, as described in the HTTP-RFC...
Hi Norbert
My client only wish to receive the http body from me (rails application
with nginx) and he is unable to extract from a full http response.
Therefore any advise to just sent down only the response body is still
very much appreciated.
T
Ps I also want to thank all have responded so far.
Colin,
Yes, it does say that, however, the "or" is important as it also says
that the transfer encoding may be removed.
The OP wants to send a response without any headers. This is within the
rfc and so should be doable, regardless of how retarded it seems to be