cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: custom post

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 21 Jun 2014 14:31:57 +0200 (CEST)

On Sat, 21 Jun 2014, Dung Nguyen wrote:

> i write a small application to upload to flickr i jz handle
> "multipart/form-data" post data my self and give to curl via
> CURLOPT_POSTFIELDS
>
> however when post flickr always return <err code="4" msg="Filesize was
> zero" />

Then you probably didn't format the data the way the receiver expected it.

> i jz wonder if my POST data is correct or not. I jz pass the
> multipart/form-data to CURLOPT_POSTFIELDS, will curl use my data or change
> it ?

libcurl will pass along the data *exactly* the way you give it to libcurl:

   http://curl.haxx.se/libcurl/c/CURLOPT_POSTFIELDS.html

but of course the rqeuest headers may also be important.

Use CURLOPT_DEBUGFUNCTION (or wireshark) to get a full trace of what your
request looks like to make sure it looks the way you intended it to.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-06-21