cURL / Mailing Lists / curl-users / Single Mail


Removing "bondary" tag from http post request.

From: shivpratap <>
Date: Mon, 17 Sep 2007 19:48:20 +0530

Hi All,

I am facing a problem with http post request, whene ever i try to post a
file, libcurl add a boundary tag into it, i want to send a xml file,
without introducing the "boundary tags in http post request.

This is the code to send a file:

URL *curl;
           CURLcode res;
           struct curl_httppost *formpost=NULL;
           struct curl_httppost *lastptr=NULL;
           struct curl_slist *headerlist=NULL;
           char buf[] = "Expect:";
           /* Fill in the file upload field like a html file upload form
        * this will simulate an equavalent request in html as:
        * <input type="file" name="">
"temp1.xml",CURLFORM_FILECONTENT, temp_pathname,CURLFORM_END);

        curl = curl_easy_init();
                    curl_easy_setopt(curl, CURLOPT_URL, server_address);
                     curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
                     res = curl_easy_perform(curl);
                     curl_slist_free_all (headerlist);

This is the http request for this, that have been intercepted by
"tcpmon" utility.

POST /cms/remote/email-inject HTTP/1.1
Pragma: no-cache
Accept: */*
Content-Length: 3702
Expect: 100-continue
Content-Type: multipart/form-data;

< Here are the Contents of the xml file >

Here boundary tag in red, i want this should not appear in http post

Any help will be appreciated.

This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.
Received on 2007-09-17