Search the web
Sign In
New User? Sign Up
www-talk
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Content-Length in multipart/related   Message List  
Reply | Forward Message #11308 of 11330 |
RE: Content-Length in multipart/related

> -----Original Message-----
> From: www-talk-request@... [mailto:www-talk-request@...]On Behalf
> Of Luca Di Luzio
> Sent: Friday, January 12, 2001 4:48 AM
> To: fish@...
> Cc: www-talk@...
> Subject: Content-Length in multipart/related
>
>
> Hi Fish (and all W3C mailing list),

Hi. :)

> I saw in the W3C mailing list your comment on the content-length in
> multipart/mixed.
> I think you are very expert of this argument and then I'd like to ask you
> how to calculate the value of the content-length in a multipart/related
> type.
> I have to send to a Wap Gateway an HTTP message where the content is a
> multipart/related type; so this message must contain the content-length
> header.
>
> This is and example:
>
> POST /cgi-bin/wap_push.cgi HTTP/1.1
> Host: www.wireless-network.com
> Date: Sun, 16 May 1999 18:13:23 GMT
> Content-Type: multipart/related; boundary=asdlfkjiurwghasf;
> type="application/xml"
> Content-Length: (???????????)
>
> --asdlfkjiurwghasf
> Content-Type: application/xml
> <?xml version="1.0"?>
> <!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN"
> "http://www.wapforum.org/DTD/pap_1.0.dtd">
> <pap>
> ..control..
> </pap>
>
> --asdlfkjiurwghasf
> Content-Type: text/vnd.wap.wml
> <?xml version="1.0"?>
> <!DOCTYPE WML PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
> "http://www.wapforum.org/DTD/wml_1.1.xml">
> <wml>
> <card>
> <p>Hello world!</p>
> </card>
> </wml>
> --asdlfkjiurwghasf--
>
> The rows of the boundary (called "--asdlfkjiurwghasf") are included in the
> content-length value?

Yes.

> And the rows called "Content-Type: application/xml" and
> "Content-Type: text/vnd.wap.wml"?

Yes.

> Thanks in advance. (and sorry for my bad English)
> Luca from Italy

The content of an HTTP message can be anything you want. Anything. But the
Content-Length header MUST specify the exact length of that content. In your
case the content is actually a multipart message surrounded by certain boundary
strings, but HTTP doesn't know or care.

Consider the following [rather unrealistic but nonetheless illustrative]
analogy: You want to send each of your three friends (who live in another city)
a box of chocolate. Each box weighs 2 kilograms.

Your address each box to the appropriate person, and then to be sure none of
them melt before they get there, you put all three of them inside a small
refrigerator (with lots of ice). The refrigerator itself weighs 25 kilograms.

You then contact the "HTTP Trucking Company" about shipping your package. The
trucking company naturally asks: "What are you shipping, and how much does it
weigh?"

What's the correct answer?

a. Three boxes of chocolate, total weight: 6 kilograms.
b. One refrigerator, total weight (including contents): 31 kilograms.

I hope you'll see that the correct answer is b. :)

Thus, the answer to your original question is: the Content-Length would be the
length of ALL data following the HTTP headers, which includes the boundary
strings and MIME headers too (which is just 'data' as far as HTTP is concerned).

--
"Fish" (David B. Trout)
fish@...




Mon Jan 15, 2001 12:19 am

fish@...
Send Email Send Email

Forward
Message #11308 of 11330 |
Expand Messages Author Sort by Date

Hi Fish (and all W3C mailing list), I saw in the W3C mailing list your comment on the content-length in multipart/mixed. I think you are very expert of this...
Luca Di Luzio
Luca_Di_Luzio-ALD001@...
Send Email
Jan 13, 2001
12:41 am

... Hi. :) ... Yes. ... Yes. ... The content of an HTTP message can be anything you want. Anything. But the Content-Length header MUST specify the exact length...
Fish
fish@...
Send Email
Jan 15, 2001
12:29 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help