Table of Contents

Class CoreWebView2WebResourceResponse

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

An HTTP response used with the WebResourceRequested event.

public class CoreWebView2WebResourceResponse
Inheritance
CoreWebView2WebResourceResponse
Inherited Members

Properties

Content

Gets HTTP response content as stream.

public Stream Content { get; set; }

Property Value

Stream

Remarks

Stream must have all the content data available by the time the WebResourceRequested event deferral of this response is completed. Stream should be agile or be created from a background thread to prevent performance impact to the UI thread. null means no content data. When providing the response data, you should consider relevant HTTP request headers just like an HTTP server would do. For example, if the request was for a video resource in a HTML video element, the request may contain the Range header to request only a part of the video that is streaming. In this case, your response stream should be only the portion of the video specified by the range HTTP request headers and you should set the appropriate Content-Range header in the response.

See Also

Headers

Gets the overridden HTTP response headers.

public CoreWebView2HttpResponseHeaders Headers { get; }

Property Value

CoreWebView2HttpResponseHeaders

ReasonPhrase

Gets or sets the HTTP response reason phrase.

public string ReasonPhrase { get; set; }

Property Value

string

StatusCode

Gets or sets the HTTP response status code.

public int StatusCode { get; set; }

Property Value

int