cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to pass custom data on top of HTTP GET

From: amit paliwal <amit.ambitions_at_gmail.com>
Date: Tue, 28 Dec 2010 17:29:01 -0500

On Tue, Dec 28, 2010 at 5:08 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Tue, 28 Dec 2010, amit paliwal wrote:
>
> I want to pass additional custom data on top of HTTP GET to the HTTP
>> Server, which means I need to build HTTP GET message including the payload
>> and send it to HTTP Server by saying curl_easy_perform().
>>
>> Do I need to use CURLOPT_READFUNCTION option and maintain one callback
>> function where i can append my custom data? But then how will the library
>> call my custom payload and send it on top of HTTP GET.
>>
>
> Make the request out to be a POST, like use CURLOPT_POSTFIELDS or
> CURLOPT_READFUNCTION or whatever you think is the best way.
>
> Then you alter the method to a GET with CURLOPT_CUSTOMREQUEST and you
> should be good to go. You may want to remove/alter the "Content-Type:" that
> a mere POST will make libcurl use by default (use CURLOPT_HTTPHEADER for
> that).
>

Reply: thanks, I will try this out, and after doing this i just need to
mention curl_easy_perform() right? can we also use CURLOPT_UPLOAD?

>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-28