IResourceResponseHeaders Property Awesomium.NET 1.7.6Awesomium.NET
Gets or sets a collection of header name-value pairs returned with this response.

Namespace: Awesomium.Core
Assembly: Awesomium.Core (in Awesomium.Core.dll) Version: 1.7.6.0
Syntax

WebHeaderCollection Headers { get; set; }

Property Value

Type: WebHeaderCollection
Exceptions

ExceptionCondition
ArgumentException You cannot assign a collection containing web request headers, to a web response.
Remarks

The table below shows how to get or set the headers of this response using the Headers collection:
ActionDetails
Get the value of a header Use ItemHttpResponseHeader (or any overload) to get the value of a header. This will silently succeed even if the header is missing. In this case, a null (Nothing in Visual Basic) String is returned.
Get a textual representation of the response's raw headers Use ToString to get a textual representation the response's raw headers. This will include the status line but it may not include additional headers internally added by Awesomium.
Set/Update a header Use ItemHttpResponseHeader (or any overload) to set or replace the value of a header. This will add the header if it's missing.
Append a value to a header Use Add(HttpResponseHeader, String) (or any overload) to append a value to a header. This will add the header and its value if it's missing, or append another value to an existing header.

Example:

// Header before:
// Accept: text/html
request.Headers.Add( HttpRequestHeader.Accept, "application/xhtml+xml" );
// Header after:
// Accept: text/html,application/xhtml+xml
Remove a header Use Remove(HttpResponseHeader) (or any overload) to remove a header. This will succeed silently even the header was missing.
Replace all headers You can assign a WebHeaderCollection created and filled with response headers by yourself, or acquired from a WebResponse or another IResourceResponse.
Note Note
A copy of the assigned collection is always made when setting this property. This means you can later safely edit the headers of this response without affecting the WebHeaderCollection instance originally assigned to this property.
Caution note Caution
This will not merge the assigned collection with the current Headers collection; it will completely replace it.
Clear all headers Use Clear to remove all headers and their values.
Note Note
This will not affect the status line and may not remove necessary headers such as Host or additional headers internally added by Awesomium.
See Also

Reference