Click or drag to resize

IRequestHeaders Property

Version 92.0.260
Header Collection - If dealing with headers that only contain a single value then it's easier to use SetHeaderByName(String, String, Boolean) or GetHeaderByName(String). You cannot modify the referrer using headers, use SetReferrer(String, ReferrerPolicy). NOTE: This collection is a copy of the underlying type, to make changes, take a reference to the collection, make your changes, then reassign the collection.

Namespace:  CefSharp
Assembly:  CefSharp (in CefSharp.dll) Version: 92.0.260.0 (92.0.260.0)
Syntax
NameValueCollection Headers { get; set; }

Property Value

Type: NameValueCollection
Examples
This example shows how to modify headers, make sure you reassign the collection once it's been modified.
var headers = request.Headers;
var userAgent = headers["User-Agent"];
headers["User-Agent"] = userAgent + " CefSharp";
request.Headers = headers;
See Also