flush docs
[mdref/mdref-http] / http / Header / Parser.md
1 # class http\Header\Parser
2
3 The parser which is underlying http\Header and http\Message.
4
5 > ***NOTE:***
6 > This class has been added in v2.3.0.
7
8 ## Constants:
9
10 ### Parser flags:
11
12 * CLEANUP
13 Finish up parser at end of (incomplete) input.
14
15 ### Parser states:
16
17 * STATE_FAILURE
18 Parse failure.
19 * STATE_START
20 Expecting HTTP info (request/response line) or headers.
21 * STATE_KEY
22 Expecting a key or already parsing a key.
23 * STATE_VALUE
24 Expecting a value or already parsing the value.
25 * STATE_VALUE_EX
26 At EOL of an header, checking whether a folded header line follows.
27 * STATE_HEADER_DONE
28 A header was completed.
29 * STATE_DONE
30 Finished parsing the headers.
31
32 > ***NOTE:***
33 > Most of this states won't be returned to the user, because the parser immediately jumps to the next expected state.