0

When you receive a post request from a client, do you get any headers after the params?

Take this request for example:

POST /path/script.cgi HTTP/1.0
From: frog@jmarshall.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32

home=Cosby&favorite+flavor=flies

If there are any other headers sent for any reason, would any ever appear after the parameters of the post content?

I am trying to figure out how to iterate post data with Java

1 Answers1

0

For Chunked Trailer Part, the answer is Yes. In your case, the HTTP request is not chunked, so I guess the answer would be No.

According to RFC7230:

A trailer allows the sender to include additional fields at the end of a chunked message in order to supply metadata that might be dynamically generated while the message body is sent, such as a message integrity check, digital signature, or post-processing status. The trailer fields are identical to header fields, except they are sent in a chunked trailer instead of the message's header section.

The structure is:

trailer-part   = *( header-field CRLF )
Community
  • 1
  • 1
shaochuancs
  • 15,342
  • 3
  • 54
  • 62