CoreWebView2WebResourceResponseView Class
View of the HTTP representation for a web resource response. The properties of this object are not mutable. This response view is used with the CoreWebView2.WebResourceResponseReceived event.
Summary
Members | Description |
---|---|
Headers | Gets the HTTP response headers as received. |
ReasonPhrase | Gets the HTTP response reason phrase. |
StatusCode | Gets the HTTP response status code. |
GetContentAsync | Gets the response content stream asynchronously. |
Properties
Headers
readonly CoreWebView2HttpResponseHeaders Headers
Gets the HTTP response headers as received.
ReasonPhrase
readonly string ReasonPhrase
Gets the HTTP response reason phrase.
StatusCode
readonly int StatusCode
Gets the HTTP response status code.
Methods
GetContentAsync
IAsyncOperation
<IRandomAccessStream> GetContentAsync()
Gets the response content stream asynchronously.
A null
stream means no content was found. Note content (if any) for redirect responses is ignored.
This method returns null
if content size is more than 123MB. If msWebView2EnableDownloadContentInWebResourceResponseReceived
feature flag is disabled, for navigations that become downloads or if response is downloadable content type (e.g., application/octet-stream), this method also returns null
. See CoreWebView2.DownloadStarting event to handle the response or enable the feature flag. The Stream object that is returned will be thread-safe and as reads will be blocking while waiting for data to be available, it is recommended to read from a background thread.
If this method is being called again before a first call has completed, it will complete at the same time all prior calls do.
If this method is being called after a first call has completed, it will return immediately (asynchronously).