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 ? 


On Jun 18, 2014, at 1:38 AM, Tok L. <[email protected]> wrote:

> Hi
> 
> I am working on a application which requires to make an api call to the
> rails application and it to return XML without any http header info.
> 
> its currently returning:
> 
> HTTP/1.1 200 OK
> Cache-Control: no-cache, no-store, max-age=0, must-revalidate
> Pragma: no-cache
> Expires: Fri, 01 Jan 1990 00:00:00 GMT
> Content-Type: application/xml; charset=
> X-Ua-Compatible: IE=Edge
> X-Request-Id: c5602cd7eb23ca8137bef8bb1f0a4f8a
> X-Runtime: 0.027900
> Server: WEBrick/1.3.1 (Ruby/1.9.3/2013-11-22)
> Date: Wed, 18 Jun 2014 05:27:48 GMT
> Content-Length: 529
> Connection: Keep-Alive
> Set-Cookie: _session_id=a8039d615674feec206e6c55a7a7afc8; path=/;
> HttpOnly
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <cXML>
>  <Response>
>    <Status code="200" text="OK"/>
>      <StartPage>
>    
> <URL>http://localhost:3000/foobar/BAh7DDoNYmFza2V0aWRJIiYxL1Y3Ti9ITS0xODg3LzIwMTQtMDYtMThUMTU6NTY6wNjcwNzkwNzMwNzgwODMwMzIGOwZUOhFzZW5kZXJzZWNyZXQw--389c54274d1cfae03e0cd943a3dcbbfb149769b9</URL>
>      </StartPage>
>  </Response>
> </cXML>
> 
> 
> 
> Can anyone help to remove http headers from the controller?
> 
> HTTP/1.1 200 OK
> Cache-Control: no-cache, no-store, max-age=0, must-revalidate
> Pragma: no-cache
> Expires: Fri, 01 Jan 1990 00:00:00 GMT
> Content-Type: application/xml; charset=
> X-Ua-Compatible: IE=Edge
> X-Request-Id: c5602cd7eb23ca8137bef8bb1f0a4f8a
> X-Runtime: 0.027900
> Server: WEBrick/1.3.1 (Ruby/1.9.3/2013-11-22)
> Date: Wed, 18 Jun 2014 05:27:48 GMT
> Content-Length: 529
> Connection: Keep-Alive
> Set-Cookie: _session_id=a8039d615674feec206e6c55a7a7afc8; path=/;
> HttpOnly
> 
> 
> 
> Thanks in advance.
> 
> 
> 
> T
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/3c497b87998592c706c03d679bb95667%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/47373F0D-ED48-466F-A277-44DBE4499DC9%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to