cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Using libcurl for realtime transactions

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 20 Dec 2007 20:27:30 +0100 (CET)

On Thu, 20 Dec 2007, Michael Peluso wrote:

> Here's my command line:
> curl https://somewhere.com/post.aspx -F "wsUSerID=XYZ" -F "wsPassword=123"
> -F "wsMessageType=X12" -F "wsRequest=REALTIME REQUEST MESSAGE"
>
> Here's the output generated for my command line using the --libcurl option:
> (I didn't want to list it all, but had some basic questions)
>
> 1) It doesn't appear to use multi-part forms, it looks like it just takes
> the entire command line in CURLOPT_WRITEDATA, true?

No. There's a limitation in the --libcurl functionality in that it doesn't
fully display the code for -F, like all the curl_formadd() invokes etc.

-F is multipart formpost. You can use --trace-ascii to verify.

The read and write callbacks are from the library's point of view. So, the
WRITEFUNCTION (and WRITEDATA) is for downloading content when the library
calls your function to write the data.

A read callback can be used for uploads/sends, but not in the case of
multipart formposts.

> 2) Is the response available at the CURLOPT_READDATA address or via the
> function pointed to by CURLOPT_READFUNCTION?

The response is sent to the write callback. With one or many invokes,
depending on the size of the response and more.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-12-20