# Proxy.HttpConnectCallback.Request


```
abstract class Proxy.HttpConnectCallback.Request : 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/kotlin/org/chromium/net/Proxy.HttpConnectCallback.Request#Request()()` |

| ### Public functions |
|---|---|
| `abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/Proxy.HttpConnectCallback.Request#close()()` Releases all resources associated with the tunnel establishment request. |
| `abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/Proxy.HttpConnectCallback.Request#proceed(java.util.List<android.util.Pair<java.lang.String,java.lang.String>>)(extraHeaders: (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/util/Pair.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!>!>)` Allows the tunnel establishment request to proceed, adding the extra headers to the underlying HTTP CONNECT request. |

## Public constructors

### Request

```
Request()
```

## Public functions

### close

```
abstract fun close(): Unit
```

Releases all resources associated with the tunnel establishment request.

If this method is called after `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/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/kotlin/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/kotlin/org/chromium/net/Proxy`. CronetEngine will then try the next `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/Proxy` in the list passed to `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/ProxyOptions` (refer to that class documentation for more info).

### proceed

```
abstract fun proceed(extraHeaders: (Mutable)List<Pair<String!, String!>!>): Unit
```

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

| Parameters |
|---|---|
| `extraHeaders: (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/util/Pair.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!>!>` | 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/kotlin/org/chromium/net/Proxy.HttpConnectCallback.Request#close()` has been called. |