Reputation: 2322
Here are the wireshark logs of 3 POST's. All posting the same data but with different content-types, resulting in different ways the data is read on the server. I'm attempt to to understand how to create POST Z.
POST X Explicitly setting form based post
gives
POST Y Omitted content-type
gives
POST Z ? My app is not able to reproduce this.
gives
I'm attempting to guess what content-type in the last POST Z (notice there are no brackets), which made the post parameters appear as data ( and apparently without a data-type )
Thanks ~B
Upvotes: 0
Views: 6824
Reputation:
I'm attempting to guess what content-type in the last POST Z (notice there are no brackets), which made the post parameters appear as data ( and apparently without a data-type )
The content type is probably "none".
You're not obliged to send a Content-Type: header with a POST request. The HTTP 1.1 spec, RFC 2616, says in section 7.2.1 "Type":
Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, therecipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
It says SHOULD, not MUST, so a sender is allowed to send an entity-body without a Content-Type: header.
Upvotes: 1