我正在開發一個項目,該項目需要客戶端使用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