cURL / Mailing Lists / curl-library / Single Mail

curl-library

How to submit full HTTP request

From: Vladimir Davydov <vdavydov_at_gmail.com>
Date: Tue, 15 Aug 2006 17:56:15 +0300

Hello.

I have full HTTP request (including request line, headers and body).
I need to send it to server, and to receive response via libcurl.
That is, in fact, I need libcurl only for _response parsing_.

I know about CURLOPT_HTTPHEADER. It allows to set custom headers.
I know about CURLOPT_CUSTOMREQUEST. It allows to set custom method in
request line.
I know about CURLOPT_HTTPVERSION. It allows to set HTTP/1.0 or
HTTP/1.1 protocol in request line.
But there is no option to set request _body_.
HTTP/1.1 standard does not prohibit sending non-empty body in any
requests (including GET).
And, of course, there is no option to set _full already prepared
custom HTTP request_.

As far as I can see for the moment, the only way to do it, is to patch
libcurl, and to add CURLOPT_RAWREQUEST option, which takes full HTTP
request as (char *) parameter.

Can anybody give an advice ?
Is there a way to solve this task in more legal way (without patching libcurl) ?

-- 
Vladimir Davydov.
Received on 2006-08-15