• Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Design
    Unite UX
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
    • jQuery
    • Angular
    • React
    • Vue
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class HTTPResponseHeaders

HTTP Response headers object

Inheritance
System.Object
HTTPHeaders
HTTPResponseHeaders
Inherited Members
HTTPHeaders._HeaderEncoding
HTTPHeaders.HTTPVersion
HTTPHeaders.storage
HTTPHeaders.GetReaderLock()
HTTPHeaders.FreeReaderLock()
HTTPHeaders.GetWriterLock()
HTTPHeaders.FreeWriterLock()
HTTPHeaders.Count()
HTTPHeaders.FindAll(String)
HTTPHeaders.ToArray()
HTTPHeaders.SortAscByKeyAndValue()
HTTPHeaders.FilterByHeaderName(String[])
HTTPHeaders.AllValues(String)
HTTPHeaders.CountOf(String)
HTTPHeaders.Add(String, String)
HTTPHeaders.AddPseudoHeader(String, String)
HTTPHeaders.Add(String, String, Boolean)
HTTPHeaders.AddRange(IEnumerable<HTTPHeaderItem>)
HTTPHeaders.GetTokenValue(String, String)
HTTPHeaders.Exists(String)
HTTPHeaders.ExistsAny(IEnumerable<String>)
HTTPHeaders.ExistsAndContains(String, String)
HTTPHeaders.ExistsAndEquals(String, String, Boolean)
HTTPHeaders.Remove(String)
HTTPHeaders.RemoveRange(String[])
HTTPHeaders.Remove(HTTPHeaderItem)
HTTPHeaders.RemoveAll()
HTTPHeaders.RenameHeaderItems(String, String)
HTTPHeaders.FromHeadersFrame(BasePipe, ArraySegment<Byte>, UInt32, Boolean)
HTTPHeaders.EscapeHeader(String, Boolean)
HTTPHeaders.Item[String]
HTTPHeaders.Item[Int32]
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.Int32 iStatusCode

The response status code number

System.String sStatusText

The response status code text

System.String[] sHeaders

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.Int32 iStatus

The response status code number

System.String[] sHeaders

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 encodingForHeaders

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.Int32

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.String

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.Boolean

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.String

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.String sHeaders

The header string

Returns
System.Boolean

TRUE if the operation succeeded, false otherwise

Overrides
HTTPHeaders.AssignFromString(String)

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.Int32

Byte Count

Overrides
HTTPHeaders.ByteCount()

Clone()

Clone this HTTPResponseHeaders object and return the result cast to an Object

Declaration
public object Clone()
Returns
System.Object

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.Collections.Generic.List<Http2.Hpack.HeaderField> headerList

The list of HTTP2 header fields

Returns
HTTPResponseHeaders

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
BasePipe pipe

The data pipe (used for HTTP2 settings and decoding header data)

System.ArraySegment<System.Byte> arrResponse

Data containing the header frame(s)

System.UInt32 streamId

The stream ID to use (if data contains multiple streams)

Returns
HTTPResponseHeaders

GetEnumerator()

Protect your enumeration using GetReaderLock

Declaration
public IEnumerator<HTTPHeaderItem> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<HTTPHeaderItem>

ParseHttp2List(HTTPResponseHeaders, List<HeaderField>)

Parse a list of response headers from HeaderField objects

Declaration
public static void ParseHttp2List(HTTPResponseHeaders headers, List<HeaderField> headerFields)
Parameters
HTTPResponseHeaders headers

The response headers object

System.Collections.Generic.List<Http2.Hpack.HeaderField> headerFields

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.Int32 iCode

HTTP Status code (e.g. 401)

System.String sDescription

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.Boolean prependStatusLine

TRUE if the response status line should be included

System.Boolean appendEmptyLine

TRUE if there should be a trailing \r\n byte sequence included

Returns
System.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
System.String

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.Boolean prependStatusLine

TRUE if the response status line should be included

System.Boolean appendEmptyLine

TRUE if there should be a trailing CRLF included

Returns
System.String

String containing http headers

Getting Started
  • Try Now
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.