Class HTTPRequestHeaders
HTTP Request headers object
Inherited Members
Namespace: Fiddler
Assembly: FiddlerCore.dll
Syntax
public class HTTPRequestHeaders : HTTPHeaders, ICloneable, IEnumerable<HTTPHeaderItem>, IEnumerable
Constructors
HTTPRequestHeaders()
Constructor for HTTP Request headers object
Declaration
public HTTPRequestHeaders()
HTTPRequestHeaders(String, String[])
This method overload allows script to easily generate headers like so: var oRH: HTTPRequestHeaders = new HTTPRequestHeaders("/clipboard.json", ['Content-Type: foo', 'Host: Baz.com']);
Declaration
public HTTPRequestHeaders(string sPath, string[] sHeaders)
Parameters
System. The request path |
System. A list of string headers in the format "name: value" |
HTTPRequestHeaders(Encoding)
Constructor for HTTP Request headers object
Declaration
public HTTPRequestHeaders(Encoding encodingForHeaders)
Parameters
System. Text encoding to be used for this set of Headers when converting to a byte array |
Fields
HTTPMethod
The HTTP Method (e.g. GET, POST, etc)
Declaration
[CodeDescription("HTTP Method or Verb from HTTP Request.")]
public string HTTPMethod
Field Value
System.
|
Properties
RawPath
Get or set the request path as a byte array
Declaration
[CodeDescription("Byte array representing the HTTP Request path.")]
public byte[] RawPath { get; set; }
Property Value
System.
|
RequestPath
Get or set the request path as a string
Declaration
[CodeDescription("String representing the HTTP Request path, e.g. '/path.htm'.")]
public string RequestPath { get; set; }
Property Value
System.
|
UriScheme
The (lowercased) URI scheme for this request (https, http, or ftp)
Declaration
[CodeDescription("URI Scheme for this HTTP Request; usually 'http' or 'https'")]
public string UriScheme { get; set; }
Property Value
System.
|
UriUserInfo
Username:Password info for FTP URLs. (either null or "user:pass@") (Note: It's silly that this contains a trailing @, but whatever...)
Declaration
[CodeDescription("For FTP URLs, returns either null or user:pass@")]
public string UriUserInfo { get; }
Property Value
System.
|
Methods
AssignFromString(String)
Parses a string and assigns the headers parsed to this object
Declaration
[CodeDescription("Replaces the current Request header set using a string representing the new HTTP headers.")]
public override bool AssignFromString(string sHeaders)
Parameters
System. The header string |
Returns
System. TRUE if the operation succeeded, false otherwise |
Overrides
ByteCount()
Get byte count of this HTTP header instance when exported to a HTTP/1.1 headers string
Declaration
public override int ByteCount()
Returns
System. Byte Count |
Overrides
Clone()
Clones the HTTP request headers
Declaration
public object Clone()
Returns
System. The new HTTPRequestHeaders object, cast to an object |
FromHttp2HeaderFields(List<HeaderField>)
Transforms a list of HTTP2 header fields into a HTTPRequestHeaders object
Declaration
public static HTTPRequestHeaders FromHttp2HeaderFields(List<HeaderField> headerList)
Parameters
System. The list of header fields |
Returns
HTTPRequest a HTTPRequestHeaders object with the parsed headers, or null if no headers in the list |
FromHttp2Request(BasePipe, ArraySegment<Byte>, UInt32, Boolean)
Transforms a binary HTTP2 request headers into a string
Declaration
public static HTTPRequestHeaders FromHttp2Request(BasePipe pipe, ArraySegment<byte> arrResponse, uint streamId, bool useNewDecoder = false)
Parameters
Base The data pipe (used for HTTP2 settings and decoding header data) |
System. Data containing the header frame(s) |
System. The stream ID to use (if data contains multiple streams) |
System. If true, a new HPACK decoder instance will be used (to prevent polluting the default decoder table). |
Returns
HTTPRequest a HTTPRequestHeaders object with the parsed headers, or null if no headers |
GetEnumerator()
Warning: You should protect your enumeration using the GetReaderLock
Declaration
public IEnumerator<HTTPHeaderItem> GetEnumerator()
Returns
System.
|
ParseHttp2List(HTTPRequestHeaders, List<HeaderField>)
Parse a list of request headers from HeaderField objects
Declaration
public static void ParseHttp2List(HTTPRequestHeaders headers, List<HeaderField> headerFields)
Parameters
HTTPRequest The request headers object |
System. The list of header fields to parse |
ToByteArray(Boolean, Boolean, Boolean)
Returns a byte array representing the HTTP headers.
Declaration
[CodeDescription("Returns current Request Headers as a byte array.")]
public byte[] ToByteArray(bool prependVerbLine, bool appendEmptyLine, bool includeProtocolInPath)
Parameters
System. TRUE if the HTTP REQUEST line (method+path+httpversion) should be included |
System. TRUE if there should be a trailing \r\n byte sequence included |
System. TRUE if the SCHEME and HOST should be included in the HTTP REQUEST LINE |
Returns
System. The HTTP headers as a byte[] |
ToByteArray(Boolean, Boolean, Boolean, String, Boolean)
Returns a byte array representing the HTTP headers.
Declaration
[CodeDescription("Returns current Request Headers as a byte array.")]
public byte[] ToByteArray(bool prependVerbLine, bool appendEmptyLine, bool includeProtocolInPath, string sVerbLineHost, bool includePseudoHeaders = false)
Parameters
System. TRUE if the HTTP REQUEST line (method+path+httpversion) should be included |
System. TRUE if there should be a trailing \r\n byte sequence included |
System. TRUE if the SCHEME and HOST should be included in the HTTP REQUEST LINE |
System. Only meaningful if prependVerbLine is TRUE, the host to use in the HTTP REQUEST LINE |
System. If True, include the Pseudo Headers in result. |
Returns
System. The HTTP headers as a byte[] |
ToString()
Returns a string representing the HTTP headers, without the SCHEME+HOST in the HTTP request line, and no trailing CRLF
Declaration
[CodeDescription("Returns a string representing the HTTP Request.")]
public override string ToString()
Returns
System. The header string |
ToString(Boolean, Boolean)
Returns a string representing the HTTP headers, without the SCHEME+HOST in the HTTP REQUEST line
Declaration
[CodeDescription("Returns a string representing the HTTP Request.")]
public string ToString(bool prependVerbLine, bool appendEmptyLine)
Parameters
System. TRUE if the HTTP REQUEST line (method+path+httpversion) should be included |
System. TRUE if there should be a trailing CRLF sequence included |
Returns
System. The header string |
ToString(Boolean, Boolean, Boolean, Boolean)
Returns a string representing the HTTP headers.
Declaration
[CodeDescription("Returns current Request Headers as a string.")]
public string ToString(bool prependVerbLine, bool appendEmptyLine, bool includeProtocolAndHostInPath, bool includePseudoHeaders = false)
Parameters
System. TRUE if the HTTP REQUEST line (method+path+httpversion) should be included |
System. TRUE if there should be a trailing CRLF sequence included |
System. TRUE if the SCHEME and HOST should be included in the HTTP REQUEST LINE (Automatically set to FALSE for CONNECT requests) |
System. If True, include the Pseudo Headers in result. |
Returns
System. The HTTP headers as a string. |