Class Parser
The Parser class exposes static methods used to parse strings or byte arrays into HTTP messages.
Inheritance
Inherited Members
Namespace: Fiddler
Assembly: FiddlerCore.dll
Syntax
public class Parser
Constructors
Parser()
Declaration
public Parser()
Methods
FindEntityBodyOffsetFromArray(Byte[], out Int32, out Int32, 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
System.Byte[]
arrData
Input array of data |
System.Int32
iHeadersLen
Returns the calculated length of the headers. |
System.Int32
iEntityBodyOffset
Returns the calculated start of the response body. |
HTTPHeaderParseWarnings
outWarnings
Any HTTPHeaderParseWarnings discovered during parsing. |
Returns
System.Boolean
True, if the parsing was successful. |
ParseRequest(String)
Parse the HTTP Request into a headers object.
Declaration
public static HTTPRequestHeaders ParseRequest(string sRequest)
Parameters
System.String
sRequest
The HTTP Request string, including at least the headers with a trailing CRLFCRLF |
Returns
HTTPRequestHeaders
HTTPRequestHeaders parsed from the string. |
ParseResponse(String)
Parse the HTTP Response into a headers object.
Declaration
public static HTTPResponseHeaders ParseResponse(string sResponse)
Parameters
System.String
sResponse
The HTTP response as a string, including at least the headers. |
Returns
HTTPResponseHeaders
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
System.IO.MemoryStream
strmClient
|
HTTPRequestHeaders
headersRequest
|
System.Byte[]
arrRequestBody
|
Returns
System.Boolean
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
System.IO.MemoryStream
strmServer
|
System.String
sRequestMethod
|
HTTPResponseHeaders
headersResponse
|
System.Byte[]
arrResponseBody
|
Returns
System.Boolean
TRUE if a response could be parsed, FALSE otherwise |