Multipart / form-data without border

Is a multipart / form-data request valid without a border? According to the specification, when there is more than 1 part, a boundary is used to separate them (and this boundary should not be part of the body). I have a request where there is a single body as raw content or a file, and in the content type we pass "multipart / form-data". Is this request really valid?

+4
source share
1 answer

I think a multipart/form-datarequest without a border is invalid .

According to RFC7231, a request with only 1 part is still valid in the multipartMIME type and must follow the multipartMIME rules :

MIME provides several types of "multipart" - encapsulation of one or more views within the same message body. All multi-page types share a common syntax ... and include a boundary parameter as part of the media type value.

According to RFC2046 , a “boundary” is required and is required:

In the Content-Type field for multipart objects , one parameter is required , the "border".

...

The only global parameter required for the "multipart" type is the boundary parameter

+5

Source: https://habr.com/ru/post/1676986/


All Articles