cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP POST from memory(not from FILE*)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 19 Jun 2002 09:24:18 +0200 (MET DST)

On Tue, 18 Jun 2002, SHIRETU wrote:

> I just want some hints about makeing a HTTP POST from a memory string (not
> from a FILE *).
>
> I've used size_t read_callback(void *, size_t, size_t, void *) function
> but it doesn't execute at all. I've created a global variable that is
> modified only by read_callback() but the variable remains unchanged. The
> destination of the POST is a working form(tested and retested and retested
> and ...).
>
> additional info:
> --using winnt
> --using VC++
> --using the latest stable version of cURL
> --succeded makeing a FILE * HTTP POST on the same URL

Are you saying that you can post from a FILE * but not from a memory area? In
that case, I really must ask you to show us the relevant pieces of the code
that sets up libcurl for this... It really is no difference in the eyes of
the library.

Also, CURLOPT_POSTFIELDS is the regular way to post using a memory location.
It doesn't even need a read callback, which is fine if you have all the data
already available.

> --can't give you the URL because it needs an username and a passwd :((

You could show us the basic functionality, with host names, paths, user name
and password replaced to something anonymous.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
----------------------------------------------------------------------------
                   Bringing you mounds of caffeinated joy
                   >>>     http://thinkgeek.com/sf    <<<
Received on 2002-06-19