cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Binary file post in C

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 22 Feb 2010 16:43:36 +0100 (CET)

On Mon, 22 Feb 2010, Dragomir Nikolov wrote:

> I need a libCurl C example
> for HTTP POST of a binary file (in Windows). The following curl
> example does exactly what I need, but I have to embed it within a C
> program:
> curl -k --data-binary
> @myfile.xml -H "Content-Type: text/xml" https://localhost:4445/test

Some good ideas:

  curl --libcurl basics.c [command line]

and some curl_easy_setopt options to read up on:

  CURLOPT_POSTFIELDS
  CURLOPT_POSTFIELDSIZE
  CURLOPT_READFUNCTION

-- 
  / 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-22