cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using callbacks to send data in GET and custom HTTP requests

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 14 Apr 2010 15:22:31 +0200 (CEST)

On Wed, 14 Apr 2010, Marco Toldo wrote:

> I need to execute some GET requests containing a generated-on-the-fly body.
> By looking at libcurl documentation I tried to do this with a simple
> callback (basically the same used in post-callback.c example) but resulting
> trace in Wireshark shows no data is sent (http header only).
>
> Provided everything works perfectly when using CURLOPT_POST, is there a way
> to do so with both GET and custom requests? Or is there another way to do
> so?

Write the code for the POST case, as you say it works fine, then you just
change the method to GET with CURLOPT_CUSTOMREQUEST!

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