Freigeben über


interface ICoreWebView2HttpRequestHeaders

Note

This reference is no longer being maintained. For the latest API reference, see WebView2 API Reference.

interface ICoreWebView2HttpRequestHeaders
  : public IUnknown

HTTP request headers.

Summary

Members Descriptions
Contains Checks whether the headers contain an entry that matches the header name.
GetHeader Gets the header value matching the name.
GetHeaders Gets the header value matching the name using an iterator.
GetIterator Gets an iterator over the collection of request headers.
RemoveHeader Removes header that matches the name.
SetHeader Adds or updates header that matches the name.

Used to inspect the HTTP request on WebResourceRequested event and NavigationStarting event.

> [!NOTE] > It is possible to modify the HTTP request from a WebResourceRequested event, but not from a NavigationStarting event.

Applies to

Product Introduced
WebView2 Win32 0.9.430
WebView2 Win32 Prerelease 0.9.488

Members

Contains

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

public HRESULT Contains(LPCWSTR name, BOOL * value)

GetHeader

Gets the header value matching the name.

public HRESULT GetHeader(LPCWSTR name, LPWSTR * value)

GetHeaders

Gets the header value matching the name using an iterator.

public HRESULT GetHeaders(LPCWSTR name, ICoreWebView2HttpHeadersCollectionIterator ** value)

GetIterator

Gets an iterator over the collection of request headers.

public HRESULT GetIterator(ICoreWebView2HttpHeadersCollectionIterator ** value)

RemoveHeader

Removes header that matches the name.

public HRESULT RemoveHeader(LPCWSTR name)

SetHeader

Adds or updates header that matches the name.

public HRESULT SetHeader(LPCWSTR name, LPCWSTR value)