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

curl-and-php

Re: POST WITHOUT HEADERS INCLUDED

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 4 Mar 2002 14:16:54 +0100 (MET)

On Mon, 4 Mar 2002, Javier Sánchez Rojas wrote:

> Sorry, I wrote it fast, I would like to send only I want, "without none
> headers" means send the headers that I want.

Please don't take the thread off the list. My reply is CC'ed back to the
list. Keep follow-ups on the list.

> I thing that in PHP the CURLOPT_HTTPHEADER don't replace the Pragma and
> Accept... ???
>
> I can't send my "Accept:" line:
>
> curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept:'));
> curl_setopt($ch, CURLOPT_HTTPHEADER, array('Pragma:'));
> curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
>
> Only modify the Content-Type

You should probably pass the disabled headers and the new header in one
single option, as I don't think it'll treat these ones properly.

The libcurl's C API only supports one list of headers, and if it is used
multiple times, the last one will be the one that is actually used.

The PHP binding *could* accept multiple ones and merge them into one before
calling libcurl, but judging from what you're saying I guess it doesn't.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-03-04