Skip to content

Latest commit

 

History

History
95 lines (64 loc) · 3.16 KB

icorewebview2httprequestheaders.md

File metadata and controls

95 lines (64 loc) · 3.16 KB
description title ms.date keywords topic_type api_name api_type api_location
HTTP request headers.
WebView2 Win32 C++ ICoreWebView2HttpRequestHeaders
05/20/2024
IWebView2, IWebView2WebView, webview2, webview, win32 apps, win32, edge, ICoreWebView2, ICoreWebView2Controller, browser control, edge html, ICoreWebView2HttpRequestHeaders
APIRef
ICoreWebView2HttpRequestHeaders
ICoreWebView2HttpRequestHeaders.Contains
ICoreWebView2HttpRequestHeaders.GetHeader
ICoreWebView2HttpRequestHeaders.GetHeaders
ICoreWebView2HttpRequestHeaders.GetIterator
ICoreWebView2HttpRequestHeaders.RemoveHeader
ICoreWebView2HttpRequestHeaders.SetHeader
COM
embeddedbrowserwebview.dll

interface ICoreWebView2HttpRequestHeaders

[!INCLUDE deprecation-note]

interface ICoreWebView2HttpRequestHeaders
  : public IUnknown

HTTP request headers.

Summary

Members Descriptions
Contains Verifies that 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

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

public HRESULT Contains(LPCWSTR name, BOOL * contains)

GetHeader

Gets the header value matching the name.

public HRESULT GetHeader(LPCWSTR name, LPWSTR * value)

The caller must free the returned string with CoTaskMemFree. See API Conventions.

GetHeaders

Gets the header value matching the name using an iterator.

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

GetIterator

Gets an iterator over the collection of request headers.

public HRESULT GetIterator(ICoreWebView2HttpHeadersCollectionIterator ** iterator)

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)