使用curl和https网址的400个错误请求

gre*_*ire 0 php curl symfony1

我正在使用curl(通过symfony的插件sfWebBrowser和sfCurlAdapter),我正在尝试在https网址上执行一个非常简单的POST请求.

使用普通浏览器执行此操作可获得200 OK,而curl会出现"400 Bad Request"错误.

我在curl上使用了verbose选项,这是我得到的:

* 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
Run Code Online (Sandbox Code Playgroud)

我也试过用firebug设置我能看到的每一个标题,这样在两种情况下请求都是一样的,没有成功.什么地方出了错?

vbe*_*nce 5

您的请求似乎没有后期数据.您可能没有正确设置卷曲传输.

Content-Length的POST 应该至少有一个标题.