cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to change Content-Type & boundary?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 14 Sep 2007 12:56:32 +0200 (CEST)

On Fri, 14 Sep 2007, 时有 wrote:

> I have some problem with change the Conten-Type & boundary,please help: I
> changed content-type in the header: Content-Type:
> multipart/related;boundary="END_OF_PART",

libcurl doesn't really support this operation. If you're not happy with
libcurl's multipart formpost as done built-in, you're better off:

1) using a normal POST and then handicraft the rest yourself in your
    application.

or

2) work on a patch that allows an application to alter the necessary pieces

> Content-Type: multipart/form-data; boundary=--------------------
> --------f7b04d5f6e80

The actual "multipart/form-data" part is meant to be able to change by setting
Content-Type to something (see lib/http.c:1957) but I'm not 100% sure it
works... When doing a multipart post, the provided content-type content only
replaces the built-in type and not the boundary part following it.

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