curl (sfCurlAdapter와 함께 symfony의 플러그인 sfWebBrowser를 통해)을 사용하고 있으며 https url에서 매우 간단한 POST 요청을 수행하려고합니다.curl 및 https url이 포함 된 400 개의 잘못된 요청
일반 브라우저에서이 작업을 수행하면 curl이 "400 Bad Request"오류가 발생하는 반면 200 OK를 표시합니다.
나는 컬에 대한 자세한 옵션을 사용하고, 여기에 내가 가진 무엇입니까 : 나는 또한하지 않고, 요청이 두 경우 모두 동일하도록 내가 불을 지르고 함께 볼 수있는 모든 헤더를 설정하려* 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
성공. 무엇이 잘못 되었나요?
게시물에 데이터를 추가해도 내용이 변경되지는 않지만 게시물에 Content-Length 헤더를 추가하면 결과가 달라집니다 : 요청 이 방향으로 검색 할 것입니다. – greg0ire
@ greg0ire postdta 자체를 기다리기 때문에 응답하지 않습니다. 이전에 Content-Length에서 보낸 많은 바이트를 정확히 보내야합니다. - postdata를 추가하면 cURL은 자동으로 'Content-Length'를 설정해야합니다. – vbence
이 게시물 데이터를 추가하지 못한 사용자 정의 코드가 있습니다. 고마워요! – greg0ire