Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response Message Body Parsing #6

Open
Oliver-Loeffler opened this issue Mar 11, 2017 · 0 comments
Open

Response Message Body Parsing #6

Oliver-Loeffler opened this issue Mar 11, 2017 · 0 comments

Comments

@Oliver-Loeffler
Copy link
Owner

See: http://httpwg.org/specs/rfc7230.html#message.body

Currently message body is considered to be a String and a StingBuilder is used to process all the message body lines if there are some.
As the message body is not defined as a simple String, instead it's a byte sequence with different possible encodings and formats, a separate class might be needed to consider all eventualities in message body parsing.

Minimal criteria for successful message body (payload) parsing:

  • define message body start criterion (http://httpwg.org/specs/rfc7230.html#http.message)
  • according to RFC7230 section 3, message body is separated by an empty line (CRLF + CRLF) from message header
  • message body presence is indicated by presence of a "Content-Length" or "Transfer-Encoding" header field (http://httpwg.org/specs/rfc7230.html#message.body)
  • Not all HTTP messages contain a message body, certain messages types such as (1xx, 204, 304) must not contain a body, whereas all others have a message body optionally of 0 bytes length

Define a class / class structure to process or parse message body depending on header fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant