Request


class Request : AutoCloseable
kotlin.Any
   ↳ android.net.http.Proxy.HttpConnectCallback.Request

Represents an HTTP CONNECT request being sent to the proxy server.

All methods may be called synchronously or asynchronously, on any thread.

Summary

Public methods
Unit

Releases all resources associated with the tunnel establishment request.

Unit
proceed(extraHeaders: MutableList<Pair<String!, String!>!>)

Allows the tunnel establishment request to proceed, adding the extra headers to the underlying HTTP CONNECT request.

Public methods

close

fun close(): Unit

Releases all resources associated with the tunnel establishment request.

If this method is called after proceed, this will have no effect on the tunnel establishment request and the underlying HTTP CONNECT, they will keep proceeding.

If this method is called before proceed, the tunnel establishment request and the underlying HTTP CONNECT request will be canceled.

When a tunnel establishment request is canceled, HttpEngine will interpret it as a failure to use the associated Proxy. HttpEngine will then try the next Proxy in the list passed to ProxyOptions (refer to that class documentation for more info).

Exceptions
java.lang.Exception if this resource cannot be closed

proceed

fun proceed(extraHeaders: MutableList<Pair<String!, String!>!>): Unit

Allows the tunnel establishment request to proceed, adding the extra headers to the underlying HTTP CONNECT request.

Parameters
extraHeaders MutableList<Pair<String!, String!>!>: A list of RFC 2616-compliant headers to be added to HTTP CONNECT request directed to the proxy server. This list can be empty, in which case no headers will be added. Note: these headers won't be added to the HTTP requests that will go through the tunnel once it is established.
This value cannot be null.
Exceptions
java.lang.IllegalArgumentException If any of the headers is not RFC 2616-compliant.
java.lang.IllegalStateException If this method is called multiple times, or after close has been called.