Table of Contents

Class CoreWebView2HttpRequestHeaders

Namespace
Microsoft.Web.WebView2.Core
Assembly
Microsoft.Web.WebView2.Core.dll

HTTP request headers.

public class CoreWebView2HttpRequestHeaders : IEnumerable<KeyValuePair<string, string>>, IEnumerable
Inheritance
CoreWebView2HttpRequestHeaders
Implements
Inherited Members

Remarks

Used to inspect the HTTP request on WebResourceRequested event and NavigationStarting event. It is possible to modify the HTTP request headers from a WebResourceRequested event, but not from a NavigationStarting event.

Methods

Contains(string)

Checks whether the headers contain an entry that matches the header name.

public bool Contains(string name)

Parameters

name string

Returns

bool

Whether the headers contain an entry that matches the header name.

See Also

GetEnumerator()

Returns an enumerator that iterates through the CoreWebView2HttpRequestHeaders or CoreWebView2HttpResponseHeaders collection.

public CoreWebView2HttpHeadersCollectionIterator GetEnumerator()

Returns

CoreWebView2HttpHeadersCollectionIterator
See Also

GetHeader(string)

Gets the header value matching the name.

public string GetHeader(string name)

Parameters

name string

Returns

string

The header value matching the name.

See Also

GetHeaders(string)

Gets the header value matching the name using a CoreWebView2HttpHeadersCollectionIterator.

public CoreWebView2HttpHeadersCollectionIterator GetHeaders(string name)

Parameters

name string

Returns

CoreWebView2HttpHeadersCollectionIterator

The header value matching the name.

See Also

GetIterator()

Gets a CoreWebView2HttpHeadersCollectionIterator over the collection of request headers.

public CoreWebView2HttpHeadersCollectionIterator GetIterator()

Returns

CoreWebView2HttpHeadersCollectionIterator
See Also

RemoveHeader(string)

Removes header that matches the name.

public void RemoveHeader(string name)

Parameters

name string
See Also

SetHeader(string, string)

Adds or updates header that matches the name.

public void SetHeader(string name, string value)

Parameters

name string
value string
See Also

See Also