typo, parameter and type fixes
[mdref/mdref-http] / http / Message / Parser.md
1 # class http\Message\Parser
2
3 The parser which is underlying http\Message.
4
5 > ***NOTE:***
6 > This class was added in v2.2.0.
7
8 ## Constants:
9
10 ### Parser flags:
11
12 * CLEANUP
13 Finish up parser at end of (incomplete) input.
14 * DUMB_BODIES
15 Soak up the rest of input if no entity length is deducible.
16 * EMPTY_REDIRECTS
17 Redirect messages do not contain any body despite of indication of such.
18 * GREEDY
19 Continue parsing while input is available.
20
21 ### Parser states:
22
23 * STATE_FAILURE
24 Parse failure.
25 * STATE_START
26 Expecting HTTP info (request/response line) or headers.
27 * STATE_HEADER
28 Parsing headers.
29 * STATE_HEADER_DONE
30 Completed parsing headers.
31 * STATE_BODY
32 Parsing the body.
33 * STATE_BODY_DUMB
34 Soaking up all input as body.
35 * STATE_BODY_LENGTH
36 Reading body as indicated by `Content-Length` or `Content-Range`.
37 * STATE_BODY_CHUNKED
38 Parsing `chunked` encoded body.
39 * STATE_BODY_DONE
40 Finished parsing the body.
41 * STATE_UPDATE_CL
42 Updating Content-Length based on body size.
43 * STATE_DONE
44 Finished parsing the message.
45
46 > ***NOTE:***
47 > Most of this states won't be returned to the user, because the parser immediately jumps to the next expected state.