ClassParser
The Parser class exposes static methods used to parse strings or byte arrays into HTTP messages.
Definition
Namespace:Fiddler
Assembly:FiddlerCore.dll
Syntax:
public class Parser
Inheritance: objectParser
Inherited Members
Constructors
Parser()
Declaration
public Parser()
Methods
FindEntityBodyOffsetFromArray(byte[], out int, out int, out HTTPHeaderParseWarnings)
Given a byte array, determines the Headers length
Declaration
public static bool FindEntityBodyOffsetFromArray(byte[] arrData, out int iHeadersLen, out int iEntityBodyOffset, out HTTPHeaderParseWarnings outWarnings)
Parameters
arrData
byte[]
Input array of data
iHeadersLen
Returns the calculated length of the headers.
iEntityBodyOffset
Returns the calculated start of the response body.
outWarnings
Any HTTPHeaderParseWarnings discovered during parsing.
Returns
True, if the parsing was successful.
ParseRequest(string, bool)
Parse the HTTP Request into a headers object.
Declaration
public static HTTPRequestHeaders ParseRequest(string sRequest, bool skipHost = false)
Parameters
sRequest
The HTTP Request string, including at least the headers with a trailing CRLFCRLF
skipHost
Whether to append Host header info or not
Returns
HTTPRequestHeaders parsed from the string.
ParseResponse(string)
Parse the HTTP Response into a headers object.
Declaration
public static HTTPResponseHeaders ParseResponse(string sResponse)
Parameters
sResponse
The HTTP response as a string, including at least the headers.
Returns
HTTPResponseHeaders parsed from the string.
TakeRequest(MemoryStream, out HTTPRequestHeaders, out byte[])
Given a MemoryStream, attempts to parse a HTTP Request starting at the current position.
Declaration
public static bool TakeRequest(MemoryStream strmClient, out HTTPRequestHeaders headersRequest, out byte[] arrRequestBody)
Parameters
strmClient
headersRequest
arrRequestBody
byte[]
Returns
TRUE if a request could be parsed, FALSE otherwise
TakeResponse(MemoryStream, string, out HTTPResponseHeaders, out byte[])
Given a MemoryStream, attempts to parse a HTTP Response starting at the current position
Declaration
public static bool TakeResponse(MemoryStream strmServer, string sRequestMethod, out HTTPResponseHeaders headersResponse, out byte[] arrResponseBody)
Parameters
strmServer
sRequestMethod
headersResponse
arrResponseBody
byte[]
Returns
TRUE if a response could be parsed, FALSE otherwise