cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Header manipulation.

From: Jose Landivar <curl_at_palosanto.com>
Date: Thu, 25 Jan 2001 16:00:25 -0800 (PST)

I have taken a closer look at PHP's support for cURL just for the heck of it. It looks like in the new realease of PHP (4.04pl1) there is more support for cURL than it is currently documented. For instance, PHP now supports the CURLOPT_HTTPHEADER option plus a whole lot more. It now requires no later than 7.4 libcurl. In the PHP distribution package there is a file called NEWS. Here they list all functions now supported. The PHP Documentation Project will take a little longer to include this in the docs it seems.

Thanks for the help!,

Jose' L.

--- Daniel Stenberg <daniel_at_haxx.se>
> wrote:
>On Thu, 25 Jan 2001, Jose Landivar wrote:
>
>> I am trying to get the XML-RPC spec implementation (www.xmlrpc.com) in
>> PHP to support HTTPS through the curl functions available. PHP has
>> support for the init, exec, etc. etc.. curl functions.
>
>Yes, so I've been told. ;-)
>
>> *******************************************************
>> Header requirements
>>
>> The format of the URI in the first line of the header is not specified.
>> For example, it could be empty, a single slash, if the server is only
>> handling XML-RPC calls. However, if the server is handling a mix of
>> incoming HTTP requests, we allow the URI to help route the request to the
>> code that handles XML-RPC requests. (In the example, the URI is /RPC2,
>> telling the server to route the request to the "RPC2" responder.)
>>
>> A User-Agent and Host must be specified.
>>
>> The Content-Type is text/xml.
>>
>> The Content-Length must be specified and must be correct.
>> *******************************************************
>>
>> Basically, User-Agent and Host must be specified. This could be dealt
>> with the 'CURLOPT_USERAGENT' and 'CURLOPT_REFERER' (I think).
>
>No. CURLOPT_USERAGENT sets user-agent all right, but Host: is automatically
>set correctly if you don't tamper with it yourself. CURLOPT_REFERER is for
>the referer field.
>
>> Furthermore, the Content-Type must be text/xml and I do not know how to
>> achieve this with the current options?.
>
>I really don't know how they offer this interface to PHP, but the standard
>libcurl has a CURLOPT_HTTPHEADER option that allows you to set a list of
>custom headers to include in the HTTP request. One of them could very well be
>"Content-Type: text/xml".
>
>> Also, the Content-Length must be specified. Can I use the
>> 'CURLOPT_INFILESIZE' option?.
>
>Just another header to set with CURLOPT_HTTPHEADER. Although a normal post
>operation using libcurl sets the Content-Length properly itself (.. which
>you override if you set the header yourself).
>
>> Any help would be helpful, I'd really appreciate it!,
>
>Just remember that libcurl is a general file transfer library and you're
>using the PHP-glue for it. I'm not fluent in PHP, I have not written the PHP
>layer and I don't know much about it (even though I now have that book Hughes
>Sterling wrote that includes curl-examples). So please have patience with me.
>
>--
> Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
>
>
>
>
>_______________________________________________
>Curl-library mailing list
>Curl-library_at_lists.sourceforge.net
>http://lists.sourceforge.net/lists/listinfo/curl-library

_____________________________________________________________
PaloSanto.com - Innovating the Internet ---> http://www.palosanto.com

_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-01-26