doude5860 2011-04-06 12:04
浏览 91
已采纳

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

I'm using curl (through symfony's plugin sfWebBrowser along with sfCurlAdapter), and I'm trying to do a very simple POST request on an https url.

Doing this with a normal browser gives 200 OK, whereas curl gets a "400 Bad Request" error.

I used the verbose option on curl, and here is what I got :

* 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

I also tried setting every header I could see with firebug, so that the request is the same in both cases, without success. What went wrong?

  • 写回答

2条回答 默认 最新

  • dongsi073898 2011-04-06 12:10
    关注

    It seems like you have no post-data with your request. You probably have not set up your curl transfer properly.

    You should have at least a Content-Length header with your POST.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码