Re: Content Type - Message Boundary issue in YouTube upload
Date: Wed, 14 Jan 2009 08:21:55 +0530
Thanks for the response.
>"I don't follow you. It uses that header when you're "uploading video
through youtube website" and "in my case too". Isn't that good then?"
No, it's not good enough. Because as I mentioned, I use
*multipart/related*and still it shows in pcap as Content-Disposition:
form-data; which is
I'm not using any HTML forms in my program.
*My doubt is:* In spite of setting multipart/related in the HTTP post, why
does the pcap show Content-Disposition: form-data;
I set it like this:
char boundary[MAX_PATH]="multipart/mixed; boundary=1a177433f849";
curl_formadd( &formpost, &lastptr,
Is there any mistake in the way I'm setting it?
>"If the multipart formpost behavior isn't what you like/need/want, you'll
need to do it all yourself with the "normal" POST approach."
I think multipart/related will do in my case. I'm providing here the HTTP
posts that I'm making. This is suggested on YouTube developers' site.
POST /feeds/api/users/default/uploads HTTP/1.1
Authorization: AuthSub token="<authentication_token>"
*Content-Type: multipart/related;* boundary="<boundary_string>"
Content-Type: application/atom+xml; charset=UTF-8
<Binary File Data>
On Tue, Jan 13, 2009 at 10:42 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Tue, 13 Jan 2009, Tanmay Anjaria wrote:
> I captured the network traffic while uploading video through youtube
>> and then captured the network traffic while running my program.
>> In the captured pcap file while uploading video through web site, it shows
>> *Content-Disposition: form-data;* for every header.
>> and in my case too, it shows the same thing, which should not be the case.
> I don't follow you. It uses that header when you're "uploading video
> through youtube website" and "in my case too". Isn't that good then?
> Anyway, libcurl does those headers since you're doing a multipart formpost.
> As I'm setting *- Content-Type: multipart/related; boundary="
> Since libcurl does the boundary strings within the body, between the
> formparts, it also has to do it in the Content-Type: header and thus you
> cannot replace that header when doing multipart formposts. I wouldn't mind
> having such abilities, but there aren't any such right now.
> If the multipart formpost behavior isn't what you like/need/want, you'll
> need to do it all yourself with the "normal" POST approach.
> / daniel.haxx.se
Received on 2009-01-14