Browse files

returns the header for post

  • Loading branch information...
1 parent ef5b236 commit c7bdbfc617599f2d76d6e3c2892a162c7eaf29e4 @steamau steamau committed with zuk Dec 7, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 Pest.php
@@ -54,6 +54,7 @@ public function post($url, $data, $headers=array()) {
$headers[] = 'Content-Length: '.strlen($data);
$curl_opts[CURLOPT_HTTPHEADER] = $headers;
$curl_opts[CURLOPT_POSTFIELDS] = $data;
+ $curl_opts[CURLOPT_HEADER] = true;
$curl = $this->prepRequest($curl_opts, $url);
$body = $this->doRequest($curl);

2 comments on commit c7bdbfc

Why would you want it this way? I use PestXML and get this for PestXML::post(...):

Couldn't parse XML response because:

    - Start tag expected, '<' not found

The response was:
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.7
ETag: "7f78472d3958e6ac47f7a09f515ccb5e"
Cache-Control: max-age=0, private, must-revalidate
X-UA-Compatible: IE=Edge,chrome=1
X-Runtime: 1.363075
Server: nginx/1.0.0 + Phusion Passenger 3.0.7 (mod_rails/mod_rack)

<?xml version="1.0" encoding="utf-8" ?>

zuk replied Jan 12, 2012

Oops yeah I really shouldn't have merged that in. Will reverse it.

Please sign in to comment.