Share via


WebViewWebResourceRequestedEventArgs.SetResponse Method

Definition

Overloads

SetResponse(Int32, String)

Sets the response for the web resource request with a status code and reason.

SetResponse(Int32, String, IReadOnlyDictionary<String,String>, Stream)

Sets the response for the web resource request.

This method must be called if the Handled property is set to true.

SetResponse(Int32, String, IReadOnlyDictionary<String,String>, Task<Stream>)

Sets the asynchronous response for the web resource request.

This method must be called if the Handled property is set to true.

SetResponse(Int32, String, String, Stream)

Sets the response for the web resource request with a status code, reason, and content type.

SetResponse(Int32, String, String, Task<Stream>)

Sets the response for the web resource request with a status code, reason, and content type.

SetResponse(Int32, String)

Source:
WebViewWebResourceRequestedEventArgs.cs

Sets the response for the web resource request with a status code and reason.

public:
 void SetResponse(int code, System::String ^ reason);
public void SetResponse(int code, string reason);
member this.SetResponse : int * string -> unit
Public Sub SetResponse (code As Integer, reason As String)

Parameters

code
Int32

The HTTP status code for the response.

reason
String

The reason phrase for the response.

Applies to

SetResponse(Int32, String, IReadOnlyDictionary<String,String>, Stream)

Source:
WebViewWebResourceRequestedEventArgs.cs

Sets the response for the web resource request.

This method must be called if the Handled property is set to true.

public:
 void SetResponse(int code, System::String ^ reason, System::Collections::Generic::IReadOnlyDictionary<System::String ^, System::String ^> ^ headers, System::IO::Stream ^ content);
public void SetResponse(int code, string reason, System.Collections.Generic.IReadOnlyDictionary<string,string>? headers, System.IO.Stream? content);
member this.SetResponse : int * string * System.Collections.Generic.IReadOnlyDictionary<string, string> * System.IO.Stream -> unit
Public Sub SetResponse (code As Integer, reason As String, headers As IReadOnlyDictionary(Of String, String), content As Stream)

Parameters

code
Int32

The HTTP status code for the response.

reason
String

The reason phrase for the response.

headers
IReadOnlyDictionary<String,String>

The headers to include in the response.

content
Stream

The content of the response as a stream.

Applies to

SetResponse(Int32, String, IReadOnlyDictionary<String,String>, Task<Stream>)

Source:
WebViewWebResourceRequestedEventArgs.cs

Sets the asynchronous response for the web resource request.

This method must be called if the Handled property is set to true.

public:
 void SetResponse(int code, System::String ^ reason, System::Collections::Generic::IReadOnlyDictionary<System::String ^, System::String ^> ^ headers, System::Threading::Tasks::Task<System::IO::Stream ^> ^ contentTask);
public void SetResponse(int code, string reason, System.Collections.Generic.IReadOnlyDictionary<string,string>? headers, System.Threading.Tasks.Task<System.IO.Stream?> contentTask);
member this.SetResponse : int * string * System.Collections.Generic.IReadOnlyDictionary<string, string> * System.Threading.Tasks.Task<System.IO.Stream> -> unit
Public Sub SetResponse (code As Integer, reason As String, headers As IReadOnlyDictionary(Of String, String), contentTask As Task(Of Stream))

Parameters

code
Int32

The HTTP status code for the response.

reason
String

The reason phrase for the response.

headers
IReadOnlyDictionary<String,String>

The headers to include in the response.

contentTask
Task<Stream>

A task that represents the asynchronous operation of getting the response content.

Remarks

This method is not asynchronous and will return immediately. The actual response will be sent when the content task completes.

Applies to

SetResponse(Int32, String, String, Stream)

Source:
WebViewWebResourceRequestedEventArgs.cs

Sets the response for the web resource request with a status code, reason, and content type.

public:
 void SetResponse(int code, System::String ^ reason, System::String ^ contentType, System::IO::Stream ^ content);
public void SetResponse(int code, string reason, string contentType, System.IO.Stream? content);
member this.SetResponse : int * string * string * System.IO.Stream -> unit
Public Sub SetResponse (code As Integer, reason As String, contentType As String, content As Stream)

Parameters

code
Int32

The HTTP status code for the response.

reason
String

The reason phrase for the response.

contentType
String

The content type of the response.

content
Stream

The content of the response as a stream.

Applies to

SetResponse(Int32, String, String, Task<Stream>)

Source:
WebViewWebResourceRequestedEventArgs.cs

Sets the response for the web resource request with a status code, reason, and content type.

public:
 void SetResponse(int code, System::String ^ reason, System::String ^ contentType, System::Threading::Tasks::Task<System::IO::Stream ^> ^ contentTask);
public void SetResponse(int code, string reason, string contentType, System.Threading.Tasks.Task<System.IO.Stream?> contentTask);
member this.SetResponse : int * string * string * System.Threading.Tasks.Task<System.IO.Stream> -> unit
Public Sub SetResponse (code As Integer, reason As String, contentType As String, contentTask As Task(Of Stream))

Parameters

code
Int32

The HTTP status code for the response.

reason
String

The reason phrase for the response.

contentType
String

The content type of the response.

contentTask
Task<Stream>

A task that represents the asynchronous operation of getting the response content.

Applies to