• 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 HTTPRequestHeaders

HTTP Request headers object

Inheritance
System.Object
HTTPHeaders
HTTPRequestHeaders
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 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.String sPath

The request path

System.String[] sHeaders

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 encodingForHeaders

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

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.Byte[]

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

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

UriUserInfo

Username:Password info for FTP URLs. (either null or &quot;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.String

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.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()

Clones the HTTP request headers

Declaration
public object Clone()
Returns
System.Object

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

The list of header fields

Returns
HTTPRequestHeaders

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
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)

System.Boolean useNewDecoder

If true, a new HPACK decoder instance will be used (to prevent polluting the default decoder table).

Returns
HTTPRequestHeaders

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.Collections.Generic.IEnumerator<HTTPHeaderItem>

ParseHttp2List(HTTPRequestHeaders, List<HeaderField>)

Parse a list of request headers from HeaderField objects

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

The request headers object

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

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

TRUE if the HTTP REQUEST line (method+path+httpversion) should be included

System.Boolean appendEmptyLine

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

System.Boolean includeProtocolInPath

TRUE if the SCHEME and HOST should be included in the HTTP REQUEST LINE

Returns
System.Byte[]

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

TRUE if the HTTP REQUEST line (method+path+httpversion) should be included

System.Boolean appendEmptyLine

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

System.Boolean includeProtocolInPath

TRUE if the SCHEME and HOST should be included in the HTTP REQUEST LINE

System.String sVerbLineHost

Only meaningful if prependVerbLine is TRUE, the host to use in the HTTP REQUEST LINE

System.Boolean includePseudoHeaders

If True, include the Pseudo Headers in result.

Returns
System.Byte[]

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

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

TRUE if the HTTP REQUEST line (method+path+httpversion) should be included

System.Boolean appendEmptyLine

TRUE if there should be a trailing CRLF sequence included

Returns
System.String

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

TRUE if the HTTP REQUEST line (method+path+httpversion) should be included

System.Boolean appendEmptyLine

TRUE if there should be a trailing CRLF sequence included

System.Boolean includeProtocolAndHostInPath

TRUE if the SCHEME and HOST should be included in the HTTP REQUEST LINE (Automatically set to FALSE for CONNECT requests)

System.Boolean includePseudoHeaders

If True, include the Pseudo Headers in result.

Returns
System.String

The HTTP headers as a string.

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.