Class HTTPResponseHeaders
HTTP Response headers object
Inherited Members
Namespace: Fiddler
Assembly: FiddlerCore.dll
Syntax
public class HTTPResponseHeaders : HTTPHeaders, ICloneable, IEnumerable<HTTPHeaderItem>, IEnumerable
Constructors
HTTPResponseHeaders()
Constructor for HTTP Response headers object
Declaration
public HTTPResponseHeaders()
HTTPResponseHeaders(Int32, 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']);
Declaration
public HTTPResponseHeaders(int iStatusCode, string sStatusText, string[] sHeaders)
Parameters
System. The response status code number |
System. The response status code text |
System. A list of string headers in the format "name: value" |
HTTPResponseHeaders(Int32, String[])
This method overload allows script to easily generate headers like so: var oRH: HTTPResponseHeaders = new HTTPResponseHeaders(200, ['Content-Type: foo', 'Blarg: Baz']);
Declaration
public HTTPResponseHeaders(int iStatus, string[] sHeaders)
Parameters
System. The response status code number |
System. A list of string headers in the format "name: value" |
HTTPResponseHeaders(Encoding)
Constructor for HTTP Response headers object
Declaration
public HTTPResponseHeaders(Encoding encodingForHeaders)
Parameters
System. Text encoding to be used for this set of Headers when converting to a byte array |
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
System.
|
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
System.
|
Properties
IsTrailers
Gets or sets a value indicating whether the object represents Response Headers or Response Trailers (GRPC)
Declaration
public bool IsTrailers { get; set; }
Property Value
System.
|
StatusDescription
Gets or sets the text associated with the response code (e.g. "OK", "Not Found", etc)
Declaration
public string StatusDescription { get; set; }
Property Value
System.
|
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
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()
Clone this HTTPResponseHeaders object and return the result cast to an Object
Declaration
public object Clone()
Returns
System. The new response headers object, cast to an object |
FromHttp2HeaderFields(List<HeaderField>)
Transforms a list of HTTP2 header fields into a HTTPResponseHeaders object
Declaration
public static HTTPResponseHeaders FromHttp2HeaderFields(List<HeaderField> headerList)
Parameters
System. The list of HTTP2 header fields |
Returns
HTTPResponse A HTTPResponseHeaders object or null if the header list was empty |
FromHttp2Response(BasePipe, ArraySegment<Byte>, UInt32)
Transforms a binary HTTP2 request/response headers into a string
Declaration
public static HTTPResponseHeaders FromHttp2Response(BasePipe pipe, ArraySegment<byte> arrResponse, uint streamId)
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) |
Returns
GetEnumerator()
Protect your enumeration using GetReaderLock
Declaration
public IEnumerator<HTTPHeaderItem> GetEnumerator()
Returns
System.
|
ParseHttp2List(HTTPResponseHeaders, List<HeaderField>)
Parse a list of response headers from HeaderField objects
Declaration
public static void ParseHttp2List(HTTPResponseHeaders headers, List<HeaderField> headerFields)
Parameters
HTTPResponse The response headers object |
System. The list of header fields to parse |
SetStatus(Int32, String)
Update the response status code and text
Declaration
public void SetStatus(int iCode, string sDescription)
Parameters
System. HTTP Status code (e.g. 401) |
System. HTTP Status text (e.g. "Access Denied") |
ToByteArray(Boolean, Boolean)
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
System. TRUE if the response status line should be included |
System. TRUE if there should be a trailing \r\n byte sequence included |
Returns
System. 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
System. Returns a string containing http headers with a status line but no trailing CRLF |
ToString(Boolean, Boolean)
Returns a string containing http headers
Declaration
[CodeDescription("Returns a string representing the HTTP headers.")]
public string ToString(bool prependStatusLine, bool appendEmptyLine)
Parameters
System. TRUE if the response status line should be included |
System. TRUE if there should be a trailing CRLF included |
Returns
System. String containing http headers |