Click or drag to resize

IRequestHeaders Property

Version 130.1.90
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: 129.0.110.0 (129.0.110.0)
Syntax
NameValueCollection Headers { get; set; }

Property Value

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