[英]400 bad request with curl and https url
我正在使用curl(通過symfony的插件sfWebBrowser和sfCurlAdapter一起使用),並且正在嘗試對https url進行非常簡單的POST請求。
使用普通瀏覽器執行此操作可獲得200 OK,而curl則會出現“ 400 Bad Request”錯誤。
我在curl上使用了詳細選項,這就是我得到的:
* About to connect() to preprod-ppps.paybox.com port 443 (#0)
* Trying 195.101.99.73... % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* connected
* Connected to preprod-ppps.paybox.com (195.101.99.73) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=FR; postalCode=78280; ST=Yvelines; L=GUYANCOURT; street=11A rue Jacques Cartier; O=PAYBOX SERVICES; OU=0002 431408608; OU=X509 Omnidomaine TBS; CN=*.paybox.com
* start date: 2009-08-17 00:00:00 GMT
* expire date: 2011-10-03 23:59:59 GMT
* subjectAltName: preprod-ppps.paybox.com matched
* issuer: C=GB; ST=Greater Manchester; L=Salford; O=Comodo CA Limited; CN=AAA Certificate Services
* SSL certificate verify ok.
> POST /PPPS.php HTTP/1.1
Host: preprod-ppps.paybox.com
Accept: */*
Accept-Encoding: gzip,deflate
< HTTP/1.1 400 Bad Request
< Date: Wed, 06 Apr 2011 11:56:35 GMT
< Server: HttpServer
< Content-Length: 226
< Connection: close
< Content-Type: text/html; charset=iso-8859-1
<
100 226 100 226 0 0 793 0 --:--:-- --:--:-- --:--:-- 1013* Closing connection #0
我還嘗試通過firebug設置我可以看到的每個標頭,以便在兩種情況下請求都相同,但沒有成功。 什么地方出了錯?
您的請求似乎沒有后期數據。 您可能沒有正確設置卷曲轉移。
POST中至少應具有Content-Length
標頭。
也許他們阻止了卷曲,因為他們認為這是一個試圖攻擊其系統的機器人。 他們將能夠從與請求一起發送的標頭中檢測用戶代理。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.