cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: POST with HEAD?

From: Liu Shan Shui <me_at_lx.sg>
Date: Fri, 7 Aug 2009 14:45:55 +0800

Hi Stephen,

 

Thanks! Seems "unnatural", but it works great!

 

Note to others who are reading this thread:

You still have to set CURL_NOBODY first before CURLOPT_CUSTOMREQUEST.

 

With regards,

Liu Shan Shui

me_at_lx.sg

"Life would be much easier if I had the source code." - Anonymous

 

From: curl-and-php-bounces_at_cool.haxx.se
[mailto:curl-and-php-bounces_at_cool.haxx.se] On Behalf Of Stephen Pynenburg
Sent: Friday, August 07, 2009 2:22 PM
To: curl with PHP
Subject: Re: POST with HEAD?

 

Hi there,
I encountered this behaviour a while ago - not sure why, but it seems you're
correct in saying that CURLOPT_POST and _NOBODY don't go together well. The
solution that worked for me was very simple: just use curl_setopt($ch,
CURLOPT_CUSTOMREQUEST, "POST") instead of setting CURLOPT_POST.
-Stephen

On Thu, Aug 6, 2009 at 22:35, Liu Shan Shui <me_at_lx.sg> wrote:

Dear cURL users,

 

Is it possible to combine POST with HEAD (sending a HTTP POST request and
expecting only headers in HTTP response)? I've tested with the options,
CURLOPT_NOBODY and CURLOPT_POST, switched around the order of setting them,
but they seem to be mutually exclusive.

 

If not, is there any alternative way where I can send a GET/POST request and
have cURL to not wait and simply ignore the entire response?

 

With regards,

Liu Shan Shui

me_at_lx.sg

"Life would be much easier if I had the source code." - Anonymous

 

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

 

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-08-07