cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: some questions about cURL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 23 Jan 2007 12:17:31 +0100 (CET)

On Tue, 23 Jan 2007, Gupta, Sandeep K wrote:

> 1. How to create HTTP request handle using cURL libraries that contains the
> name of the target resource of the specified HTTP verb, generally a file
> name and HTTP version e.g. HTTP/1.1?

It defaults to GET and HTTP/1.1 so just setting a URL will make that. You can
change both the request keyword and HTTP version with curl_easy_setopt
options. The file name is extracted from the URL you provide.

> 2. Is there any API which adds one or more HTTP request headers to
> the HTTP request handle else how to add it with cURL?

Yes, see CURLOPT_HTTPHEADER.

> 3. Is there any API's to send data instead of file if I want to send
> specific body header and trailer before and after sending the file.

You can set a read callback with CURLOPT_READFUNCTION and custom pointer with
CURLOPT_READDATA and then you can send whatever you want.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-01-23