Click or drag to resize

RequestHeaders Property

Version 106.0.290
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.Core (in CefSharp.Core.dll) Version: 106.0.290.0
Syntax
public NameValueCollection Headers { get; set; }

Property Value

Type: NameValueCollection

Implements

IRequestHeaders
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