我正在开发一个项目,该项目需要客户端使用rails应用程序对 my my API进行api调用,并且它返回的XML没有任何http标头信息。删除Http标头响应
其目前返回:
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/BAh7DDoNYmFza2V0aWRJI...
</StartPage>
</Response>
</cXML>
谁能帮助去除控制器或任何 配置中的所有HTTP头?这部分在下面。
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
我现在正在使用nginx。
我有一些说,这是一种无稽之谈的请求,因为HTTP服务器由 定义使用头相互交谈。但我也被告知W3认为不然。
http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4
我也用Google搜索周围尝试其他的解决方案改变了我的轨控制器没有任何成功小时。最后的手段是否可能改变Nginx的配置,并不会影响整个Rails应用程序,而不仅仅是api调用,还是有办法单独调用一个调用?
在此先感谢。
T