2
特定のURLは常に空のHTTP 400レスポンスを返します(他の多くのURLは正常に動作します)。例:Typhoeusでリクエストを作成すると、特定のURLが空の '400'レスポンスを返す
1.9.3p0 :002 > e = Typhoeus::Easy.new
e.url = "http://us.asos.com/NW3/NW3-Highgate-Seersucker-Pinafore-Dress/Prod/pgeproduct.aspx?iid=1988231&cid=8799&sh=0&pge=0&pgesize=20&sort=-1&clr=Navy%252fivory&r=2"
1.9.3p0 :004 > e.perform => 400
1.9.3p0 :005 > y e
--- !ruby/object:Typhoeus::Easy
curl_return_code: 0
headers: {}
method: :get
response_body: ""
response_header: |
HTTP/1.1 400 Bad Request
Content-Type: text/html
Server: Microsoft-IIS/7.0
Content-Length: 0
Vary: Accept-Encoding
Date: Mon, 07 May 2012 19:35:28 GMT
Connection: keep-alive
ssl_version: :default
url: http://us.asos.com/NW3/NW3-Highgate-Seersucker-Pinafore-Dress/Prod/pgeproduct.aspx?iid=1988231&cid=8799&sh=0&pge=0&pgesize=20&sort=-1&clr=Navy%252fivory&r=2 => nil
は逆に、同じマシン上に、数秒後には、コマンドラインのcURLを経由して動作します:
[email protected]:~/fashism$ curl -I "http://us.asos.com/NW3/NW3-Highgate-Seersucker-Pinafore-Dress/Prod/pgeproduct.aspx?iid=1988231&cid=8799&sh=0&pge=0&pgesize=20&sort=-1&clr=Navy%252fivory&r=2"
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html;charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-RuleEngine-Key: US1.0:ReferrerAnyOrNoneSiteDotUSPreferenceUSOrNone
X-Powered-By: ASP.NET
Date: Mon, 07 May 2012 19:54:03 GMT
Connection: keep-alive
Set-Cookie: AsosExecutionEngine=ExemptionTimeout=05/07/2012 20:14; expires=Tue, 07-May-2013 19:54:02 GMT; path=/
Set-Cookie: ASP.NET_SessionId=sd2hw4yu4l4jwmevc3gyan55; path=/; httponly
Set-Cookie: asos=topcatidHitCount=1; expires=Tue, 07-May-2013 19:54:02 GMT; path=/
Set-Cookie: asos=topcatidHitCount=1¤cyid=1&topcatid=9057&customerguid=b5da62eb44de45eeadd2f36ec90332ca; expires=Tue, 07-May-2013 19:54:02 GMT; path=/
Set-Cookie: asosbasket=basketitemcount=0&basketitemtotalretailprice=0; expires=Mon, 07-May-2012 20:54:02 GMT; path=/
Set-Cookie: stop_mobi=yes; path=/
[email protected]:~/fashism$
任意のアイデア?たとえそれが解決策を見つけるために私に行く方向を与えているだけであっても、支援は大いに評価されるでしょう。
ありがとうございました! Typhoeus github issue上の私の答えから〜ジェームズ