HttpLibParserState Enum

Namespace: System.Net.Http.Headers
Assembly: System.Net.Http.WinHttp (in System.Net.Http.WinHttp.dll)

Defines the states used by the HTTP header parser. This enumeration is typically used internally by the .NET networking stack and is not intended for direct use by application developers.

Members

Name Value Description
None 0 Indicates that the parser is in an initial or undefined state.
RequestLine 1 Indicates that the parser is currently processing the HTTP request line.
Headers 2 Indicates that the parser is currently processing HTTP headers.
Content 3 Indicates that the parser is currently processing the HTTP message body (content).
Trailers 4 Indicates that the parser is currently processing HTTP trailers.
Done 5 Indicates that the parser has completed its operation.
Error 6 Indicates that an error occurred during parsing.

Remarks

The HttpLibParserState enum represents the different stages a parser goes through when processing an HTTP message. This state management is crucial for correctly interpreting the structure and content of HTTP requests and responses, especially when dealing with complex or chunked data.

Developers working with low-level HTTP parsing or custom HTTP clients might encounter this enum indirectly through internal library mechanisms. For most standard HTTP operations using classes like HttpClient, direct interaction with HttpLibParserState is not required.

Syntax

public enum HttpLibParserState {
    None = 0,
    RequestLine = 1,
    Headers = 2,
    Content = 3,
    Trailers = 4,
    Done = 5,
    Error = 6
}
                    

See Also