header parser 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 ## Changelog:
6
7 | Version | Change
8 |---------|--------
9 | 2.3.0 | Added http\Header\Parser API
10
11 ## Constants:
12
13 ### Parser flags:
14
15 * CLEANUP
16 Finish up parser at end of (incomplete) input.
17
18 ### Parser states:
19
20 * STATE_FAILURE
21 Parse failure.
22 * STATE_START
23 Expecting HTTP info (request/response line) or headers.
24 * STATE_KEY
25 Expecting a key or already parsing a key.
26 * STATE_VALUE
27 Expecting a value or already parsing the value.
28 * STATE_VALUE_EX
29 At EOL of an header, checking whether a folded header line follows.
30 * STATE_HEADER_DONE
31 A header was completed.
32 * STATE_DONE
33 Finished parsing the headers.
34
35 > ***NOTE:***
36 > Most of this states won't be returned to the user, because the parser immediately jumps to the next expected state.