AndroidMessageHandler.SetupRequest Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Configure the HttpURLConnection before the request is sent. This method is meant to be overriden by applications which need to perform some extra configuration steps on the connection. It is called with all the request headers set, pre-authentication performed (if applicable) but before the request body is set (e.g. for POST requests). The default implementation in AndroidMessageHandler does nothing.
protected virtual System.Threading.Tasks.Task SetupRequest(System.Net.Http.HttpRequestMessage request, Java.Net.HttpURLConnection conn);
abstract member SetupRequest : System.Net.Http.HttpRequestMessage * Java.Net.HttpURLConnection -> System.Threading.Tasks.Task
override this.SetupRequest : System.Net.Http.HttpRequestMessage * Java.Net.HttpURLConnection -> System.Threading.Tasks.Task
Parameters
- request
- HttpRequestMessage
Request data
- conn
- HttpURLConnection
Pre-configured connection instance
Returns
A task that completes when the additional connection setup is finished. The default implementation returns Task.CompletedTask.
Remarks
The default implementation first checks that the handler has not been disposed and can throw ObjectDisposedException. The caller awaits this method after headers and pre-authentication are configured, and before it configures the request body or connects to the server.