cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Odd comment for curlopt_httpget and other questions

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 4 Feb 2010 13:25:37 +0100 (CET)

On Thu, 4 Feb 2010, vick wrote:

> /* Set this to force the HTTP request to get back to GET. Only really
> usable if POST, PUT or a custom request have been used first.
> */
> CINIT(HTTPGET, LONG, 80),
>
> Why is it "only really usable" if post, put, custom request have been used
> first?

I think it refers to the fact that libcurl defaults to GET with HTTP so unless
you changed it before, there's no need to set it GET.

> And how do you set POST, PUT and DELETE, HEAD, OPTIONS if that is what you
> want

CURLOPT_POSTFIELDS and CURLOPT_POST
CURLOPT_HTTPPOST
CURLOPT_CUSTOMREQUEST
CURLOPT_NOBODY

Are a few good starting points.

> (with in-memory data, not files)

That's usually up to your callbacks on how the data is read/written.

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