# Proxy.HttpConnectCallback.Request


```
public abstract class Proxy.HttpConnectCallback.Request implements AutoCloseable
```

<br />

*** ** * ** ***

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

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/Proxy.HttpConnectCallback.Request#Request()()` |

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/Proxy.HttpConnectCallback.Request#close()()` Releases all resources associated with the tunnel establishment request. |
| `abstract void` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/Proxy.HttpConnectCallback.Request#proceed(java.util.List<android.util.Pair<java.lang.String,java.lang.String>>)(@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html>> extraHeaders)` Allows the tunnel establishment request to proceed, adding the extra headers to the underlying HTTP CONNECT request. |

## Public constructors

### Request

```
public Request()
```

## Public methods

### close

```
public abstract void close()
```

Releases all resources associated with the tunnel establishment request.

If this method is called after `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/Proxy.HttpConnectCallback.Request#proceed(java.util.List<android.util.Pair<java.lang.String,java.lang.String>>)`, 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 `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/Proxy.HttpConnectCallback.Request#proceed(java.util.List<android.util.Pair<java.lang.String,java.lang.String>>)`, the tunnel establishment request and the underlying HTTP CONNECT request will be canceled.

When a tunnel establishment request is canceled, CronetEngine will interpret it as a failure to use the associated `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/Proxy`. CronetEngine will then try the next `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/Proxy` in the list passed to `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/ProxyOptions` (refer to that class documentation for more info).

### proceed

```
public abstract void proceed(@NonNull List<Pair<String, String>> extraHeaders)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html>> extraHeaders` | 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. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If any of the headers is not RFC 2616-compliant. |
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If this method is called multiple times, or after `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/Proxy.HttpConnectCallback.Request#close()` has been called. |