I want to ask a question about the multipart/form data. I find the http header of multipart post and the Content-Type: multipart/form-data; boundary=—–…—boundaryNumber. I want to ask, how many of ‘-‘ between the boundaryNumber and ‘=’?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not a single
-is mandatory. You can have any number of them. It is actually a mystery to me why user-agents tend to add so many. It is probably traditional because in the old days, when people still regularly looked at the actual protocol traffic, it provided some nice visual separation. Nowadays it is pointless.Note however, that when you use the boundary in the stream, it must be prefixed by two hyphens (
--). That’s part of the protocol. Of course, the fact that most user-agents use lots of hyphens in their boundary makes this very hard to see by example.Furthermore, the last boundary (which marks the end of the message) is prefixed and suffixed by two hyphens (
--).So in summary, you could call your boundary
OMGWTFPLZDIEKTHX, and then your traffic could look like this: