Proxy.HttpConnectCallback.Request


public static final class Proxy.HttpConnectCallback.Request
extends Object implements AutoCloseable

java.lang.Object
   ↳ 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

void close()

Releases all resources associated with the tunnel establishment request.

void proceed(List<Pair<StringString>> extraHeaders)

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

Inherited methods

Public methods

close

public void close ()

Releases all resources associated with the tunnel establishment request.

If this method is called after proceed(List), 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(List), 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).

proceed

public void proceed (List<Pair<StringString>> extraHeaders)

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

Parameters
extraHeaders List: 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.

Throws
IllegalArgumentException If any of the headers is not RFC 2616-compliant.
IllegalStateException If this method is called multiple times, or after close() has been called.