ClassHTTPResponseHeaders
HTTP Response headers object
Definition
Namespace:Fiddler
Assembly:FiddlerCore.dll
Syntax:
public class HTTPResponseHeaders : HTTPHeaders, ICloneable, IEnumerable<HTTPHeaderItem>, IEnumerable
Inheritance: objectHTTPHeadersHTTPResponseHeaders
Implements:
Inherited Members
Constructors
HTTPResponseHeaders()
Constructor for HTTP Response headers object
Declaration
public HTTPResponseHeaders()
HTTPResponseHeaders(Encoding)
Constructor for HTTP Response headers object
Declaration
public HTTPResponseHeaders(Encoding encodingForHeaders)
Parameters
encodingForHeaders
Text encoding to be used for this set of Headers when converting to a byte array
HTTPResponseHeaders(int, string, string[])
This method overload allows script to easily generate headers like so: var oRH: HTTPResponseHeaders = new HTTPResponseHeaders(200, "Ok", ['Content-Type: foo', 'Blarg: Baz']);
HTTPResponseHeaders(int, string[])
This method overload allows script to easily generate headers like so: var oRH: HTTPResponseHeaders = new HTTPResponseHeaders(200, ['Content-Type: foo', 'Blarg: Baz']);
Fields
HTTPResponseCode
Status code from HTTP Response. If setting, also set HTTPResponseStatus too!
Declaration
[CodeDescription("Status code from HTTP Response. Call SetStatus() instead of manipulating directly.")]
public int HTTPResponseCode
Field Value
HTTPResponseStatus
Code AND Description of Response Status (e.g. '200 OK').
Declaration
[CodeDescription("Status text from HTTP Response (e.g. '200 OK'). Call SetStatus() instead of manipulating directly.")]
public string HTTPResponseStatus
Field Value
Properties
IsTrailers
Gets or sets a value indicating whether the object represents Response Headers or Response Trailers (GRPC)
StatusDescription
Gets or sets the text associated with the response code (e.g. "OK", "Not Found", etc)
Methods
AssignFromString(string)
Parses a string and assigns the headers parsed to this object
Declaration
[CodeDescription("Replaces the current Response header set using a string representing the new HTTP headers.")]
public override bool AssignFromString(string sHeaders)
Parameters
sHeaders
The header string
Returns
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
Clone()
Clone this HTTPResponseHeaders object and return the result cast to an Object
Declaration
public object Clone()
Returns
The new response headers object, cast to an object
Implements
FromHttp2HeaderFields(List<HeaderField>)
Transforms a list of HTTP2 header fields into a HTTPResponseHeaders object
Declaration
public static HTTPResponseHeaders FromHttp2HeaderFields(List<HeaderField> headerList)
Parameters
headerList
List<HeaderField>
The list of HTTP2 header fields
Returns
A HTTPResponseHeaders object or null if the header list was empty
FromHttp2Response(BasePipe, ArraySegment<byte>, uint)
Transforms a binary HTTP2 request/response headers into a string
Declaration
public static HTTPResponseHeaders FromHttp2Response(BasePipe pipe, ArraySegment<byte> arrResponse, uint streamId)
Parameters
pipe
The data pipe (used for HTTP2 settings and decoding header data)
arrResponse
Data containing the header frame(s)
streamId
The stream ID to use (if data contains multiple streams)
Returns
GetEnumerator()
Protect your enumeration using GetReaderLock
Declaration
public IEnumerator<HTTPHeaderItem> GetEnumerator()
Returns
Implements
ParseHttp2List(HTTPResponseHeaders, List<HeaderField>)
Parse a list of response headers from HeaderField objects
Declaration
public static void ParseHttp2List(HTTPResponseHeaders headers, List<HeaderField> headerFields)
Parameters
headers
The response headers object
headerFields
List<HeaderField>
The list of header fields to parse
SetStatus(int, string)
Update the response status code and text
ToByteArray(bool, bool)
Returns a byte array representing the HTTP headers.
Declaration
[CodeDescription("Returns a byte[] representing the HTTP headers.")]
public byte[] ToByteArray(bool prependStatusLine, bool appendEmptyLine)
Parameters
prependStatusLine
TRUE if the response status line should be included
appendEmptyLine
TRUE if there should be a trailing \r\n byte sequence included
Returns
byte[]
Byte[] containing the headers
ToString()
Returns a string containing the http headers
Declaration
[CodeDescription("Returns a string containing the HTTP Response headers.")]
public override string ToString()
Returns
Returns a string containing http headers with a status line but no trailing CRLF
Overrides
ToString(bool, bool)
Returns a string containing http headers
Declaration
[CodeDescription("Returns a string representing the HTTP headers.")]
public string ToString(bool prependStatusLine, bool appendEmptyLine)
Parameters
prependStatusLine
TRUE if the response status line should be included
appendEmptyLine
TRUE if there should be a trailing CRLF included
Returns
String containing http headers