---
title: RequestHandle
summary: The low-level interface to HTTP requests.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/
---

**Kind:** Struct  
**Module:** [handle](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/)  
**Package:** fastly 0.13.1  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#59

```rust
pub struct RequestHandle { /* private fields */ }
```

The low-level interface to HTTP requests.

For most applications, you should use [`Request`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/) instead of this
interface. See the top-level [`handle`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/) documentation for more details.

## Getting the client request

Call [`RequestHandle::from_client()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-from_client) to get the client request being handled by this execution
of the Compute program.

## Creation and conversion

New requests can be created programmatically with [`RequestHandle::new()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-new). In addition, you can
convert to and from [`Request`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/) using [`Request::from_handles()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/#method-from_handles) and
[`Request::into_handles()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/#method-into_handles).

## Sending backend requests

Requests can be sent to a backend in blocking or asynchronous fashion using
[`send()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-send), [`send_async()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-send_async), or
[`send_async_streaming()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-send_async_streaming).

## Constants

### INVALID

**Type:** `Self`  
**Flags:** read-only  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#78

An invalid handle.

This is primarily useful to represent uninitialized values when using the interfaces in
[`fastly_sys`](https://docs.rs/fastly_sys/latest/fastly_sys/index.html).

## Methods

### append_header

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#465

```rust
fn append_header(&mut self, name: &HeaderName, value: &HeaderValue)
```

Add a request header with given value.

Unlike [`insert_header()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-insert_header), this does not discard existing values
for the same header name.

**Parameters**

- `self`: `&mut Self`
- `name`: `&HeaderName`
- `value`: `&HeaderValue`

### as_u32

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#117

```rust
fn as_u32(&self) -> u32
```

Get the underlying representation of the handle.

This should only be used when calling the raw ABI directly, and care should be taken not to
reuse or alias handle values.

**Parameters**

- `self`: `&Self`

**Returns**

`u32`

### as_u32_mut

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#132

```rust
fn as_u32_mut(&mut self) -> &mut u32
```

Get a mutable reference to the underlying `u32` representation of the handle.

This should only be used when calling the raw ABI directly, and care should be taken not to
reuse or alias handle values.

**Parameters**

- `self`: `&mut Self`

**Returns**

`&mut u32`

### bot_analyzed

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1409

```rust
fn bot_analyzed(&self) -> bool
```

Whether bot detection analysis was performed for this request.

**Parameters**

- `self`: `&Self`

**Returns**

`bool`

### bot_category_bytes

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1453

```rust
fn bot_category_bytes(&self) -> Option<Bytes>
```

A byte string indicating the type of bot detected (e.g., `SEARCH-ENGINE-CRAWLER`, `AI-CRAWLER`, `SUSPECTED-BOT`).
Returns `None` if bot detection was not executed.

**Warning:** Values may change over time. Use this for logging or informational purposes.
For conditional logic, use the [`bot_category_kind()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-bot_category_kind) value.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<Bytes>`

### bot_category_kind

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1466

```rust
fn bot_category_kind(&self) -> Option<u32>
```

A value uniquely identifying the type of bot detected.
Returns `None` if bot detection was not executed.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<u32>`

### bot_detected

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1423

```rust
fn bot_detected(&self) -> bool
```

Whether a bot was detected in the request.

**Parameters**

- `self`: `&Self`

**Returns**

`bool`

### bot_name_bytes

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1441

```rust
fn bot_name_bytes(&self) -> Option<Bytes>
```

A byte string identifying the specific bot detected (e.g., `GoogleBot`, `GPTBot`, `Bingbot`).
Returns `None` if bot detection was not executed or no bot was detected.

**Warning:** Values may change over time. Use this for logging or informational purposes.
For conditional logic, use the [`bot_category_kind()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-bot_category_kind) value.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<Bytes>`

### bot_verified

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1485

```rust
fn bot_verified(&self) -> Option<bool>
```

Whether the detected bot is a verified bot.
Returns `None` if bot detection was not executed or no bot was detected.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<bool>`

### client_ddos_detected

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1185

```rust
fn client_ddos_detected(&self) -> Option<bool>
```

Returns whether the request was tagged as contributing to a DDoS attack

**Parameters**

- `self`: `&Self`

**Returns**

`Option<bool>`

### client_ip_addr

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1085

```rust
fn client_ip_addr(&self) -> Option<IpAddr>
```

Returns the IP address of the client making the HTTP request.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<IpAddr>`

### client_original_header_count

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1369

```rust
fn client_original_header_count(&self) -> Result<Option<u32>, FastlyStatus>
```

Returns the number of headers in the client request as originally received.

If this is not a valid downstream handle then this will return `None`.

**Parameters**

- `self`: `&Self`

**Returns**

`Result<Option<u32>, FastlyStatus>`

### client_original_header_names

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1359

```rust
fn client_original_header_names(&self, buf_size: usize) -> impl Iterator<Item = Result<String, BufferSizeError>>
```

Returns the client request's header names exactly as they were originally received.

This includes both the original header name characters' cases, as well as the original order of
the received headers.

If there is a header name that is longer than the provided buffer, this will return a
[`BufferSizeError`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/error/struct.BufferSizeError/); you can retry with a larger buffer size if necessary.

**Parameters**

- `self`: `&Self`
- `buf_size`: `usize`

**Returns**

`impl Iterator<Item = Result<String, BufferSizeError>>`

### client_tls_cipher_openssl_name

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1335

```rust
fn client_tls_cipher_openssl_name(&self) -> Option<String>
```

Get the cipher suite used to secure the downstream client TLS connection, as a string,
panicking if it is not UTF-8.

The value returned will be consistent with the [OpenSSL
name](https://testssl.sh/openssl-iana.mapping.html) for the cipher suite.

#### Examples

```rust
let handle = RequestHandle::from_client();
assert_eq!(
    handle.client_tls_cipher_openssl_name().unwrap(),
    "ECDHE-RSA-AES128-GCM-SHA256"
);
```

**Parameters**

- `self`: `&Self`

**Returns**

`Option<String>`

### client_tls_cipher_openssl_name_bytes

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1343

```rust
fn client_tls_cipher_openssl_name_bytes(&self) -> Option<Bytes>
```

Like [`Self::client_tls_cipher_openssl_name`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-client_tls_cipher_openssl_name), but supports non-UTF-8 byte string.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<Bytes>`

### client_tls_client_cert_verify_result

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1302

```rust
fn client_tls_client_cert_verify_result(&self) -> Option<ClientCertVerifyResult>
```

Returns the [`ClientCertVerifyResult`](https://docs.rs/fastly_shared/latest/fastly_shared/enum.ClientCertVerifyResult.html) from the downstream client mTLS handshake.

Returns `None` if not available.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<ClientCertVerifyResult>`

### client_tls_client_hello

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1204

```rust
fn client_tls_client_hello(&self) -> Option<Bytes>
```

Get the raw bytes sent by the client in the TLS ClientHello message.

See [RFC 5246](https://tools.ietf.org/html/rfc5246#section-7.4.1.2) for details.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<Bytes>`

### client_tls_client_raw_certificate

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1278

```rust
fn client_tls_client_raw_certificate(&self) -> Option<String>
```

Get the client certificate used to secure the downstream client mTLS connection,
as a string, panicking if it is not UTF-8.

The value returned will be based on PEM format.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<String>`

### client_tls_client_raw_certificate_bytes

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1285

```rust
fn client_tls_client_raw_certificate_bytes(&self) -> Option<Bytes>
```

Like [`Self::client_tls_client_raw_certificate`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-client_tls_client_raw_certificate), but supports non-UTF-8 byte sequences.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<Bytes>`

### client_tls_client_servername

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1216

```rust
fn client_tls_client_servername(&self) -> Option<String>
```

Get the hostname sent by the client in the TLS ServerName Indication.

See [RFC 6066](https://tools.ietf.org/html/rfc6066#section-3) for details.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<String>`

### client_tls_ja3_md5

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1227

```rust
fn client_tls_ja3_md5(&self) -> Option<[u8; 16]>
```

Get the JA3 hash of the TLS ClientHello message.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<[u8; 16]>`

### client_tls_ja4

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1254

```rust
fn client_tls_ja4(&self) -> Option<String>
```

Get the JA4 hash of the TLS ClientHello message.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<String>`

### client_tls_protocol

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1392

```rust
fn client_tls_protocol(&self) -> Result<Option<String>, FromUtf8Error>
```

Get the TLS protocol version used to secure the downstream client TLS connection, as a
string, panicking if it is not UTF-8.

#### Examples

```rust
let handle = RequestHandle::from_client();
assert_eq!(handle.client_tls_protocol().unwrap().as_deref(), Some("TLSv1.2"));
```

**Parameters**

- `self`: `&Self`

**Returns**

`Result<Option<String>, std::string::FromUtf8Error>`

### client_tls_protocol_bytes

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1399

```rust
fn client_tls_protocol_bytes(&self) -> Option<Bytes>
```

Like [`Self::client_tls_protocol`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-client_tls_protocol), but supports non-UTF-8 byte sequences.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<Bytes>`

### close

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#974

```rust
fn close(self) -> Result<(), HandleError>
```

Close the RequestHandle by removing it from the host Session. If the handle has already
been closed an error will be returned. When calling
send/send_async/send_async_streaming the RequestHandle is consumed and
it's cleaned up. You should only call `close` if you have not sent a
request yet and want to clean up the resources if not being used.

#### Examples

```rust
let request = RequestHandle::new();
// The handle is not being used so we can close it out without any
// trouble
request.close()?;
```

**Parameters**

- `self`: `Self`

**Returns**

`Result<(), HandleError>`

### fastly_key_is_valid

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1072

```rust
fn fastly_key_is_valid(&self) -> bool
```

Returns whether or not a valid Fastly-Key for this service was received.

**Parameters**

- `self`: `&Self`

**Returns**

`bool`

### from_client

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#194

```rust
fn from_client() -> Self
```

Get a handle to the client request being handled by this execution of the Compute program.

#### Panics

This method panics if the client request has already been retrieved by this method,
[`client_request_and_body()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/fn.client_request_and_body/), or [`Request::from_client()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/#method-from_client).

**Returns**

`Self`

### from_u32

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#159

```rust
unsafe fn from_u32(handle: u32) -> Self
```

Turn a handle representation into a `RequestHandle` Handle, claiming ownership of the
underlying resource.

#### Safety

This should only be used when calling the raw ABI directly, and care should be taken not to
reuse or alias handle values.

**Parameters**

- `handle`: `u32`

**Returns**

`Self`

### get_header_names

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#223

```rust
fn get_header_names(&self, buf_size: usize) -> impl Iterator<Item = Result<HeaderName, BufferSizeError>> + '_
```

Read the request's header names via a buffer of the provided size.

If there is a header name that is longer than `buf_size`, this will return a
[`BufferSizeError`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/error/struct.BufferSizeError/); you can retry with a larger buffer size if necessary.

**Parameters**

- `self`: `&Self`
- `buf_size`: `usize`

**Returns**

`impl Iterator<Item = Result<HeaderName, BufferSizeError>> + '_`

### get_header_value

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#407

```rust
fn get_header_value(&self, name: &HeaderName, max_len: usize) -> Result<Option<HeaderValue>, BufferSizeError>
```

Get the value of a header, or `None` if the header is not present.

If there are multiple values for the header, only one is returned. See
[`get_header_values()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-get_header_values) if you need to get all of the values.

If the value is longer than `max_len`, this will return a [`BufferSizeError`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/error/struct.BufferSizeError/); you can retry
with a larger buffer size if necessary.

**Parameters**

- `self`: `&Self`
- `name`: `&HeaderName`
- `max_len`: `usize`

**Returns**

`Result<Option<HeaderValue>, BufferSizeError>`

### get_header_values

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#322

```rust
fn get_header_values<'a>(&'a self, name: &'a HeaderName, buf_size: usize) -> impl Iterator<Item = Result<HeaderValue, BufferSizeError>> + 'a
```

Get the header values for the given name via a buffer of the provided size.

If there is a header value that is longer than the buffer, this will return a
[`BufferSizeError`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/error/struct.BufferSizeError/); you can retry with a larger buffer size if necessary.

#### Examples

Collect all the header values into a [`Vec`](https://doc.rust-lang.org/stable/alloc/vec/struct.Vec.html):

```rust
let name = HeaderName::from_static("My-App-Header");
let buf_size = 128;
let header_values: Vec<HeaderValue> = request
    .get_header_values(&name, buf_size)
    .collect::<Result<Vec<HeaderValue>, _>>()?;
```

To try again with a larger buffer if the first call fails, you can use
[`unwrap_or_else()`](https://doc.rust-lang.org/stable/core/result/Result/fn.unwrap_or_else.html):

```rust
let name = HeaderName::from_static("My-App-Header");
let buf_size = 128;

// Collect header values into a `Vec<HeaderValue>`, with a buffer size of `128`.
// If the first call fails, print our error and then try to collect header values
// again. The second call will use a larger buffer size of `1024`.
let header_values: Vec<HeaderValue> = request
    .get_header_values(&name, buf_size)
    .collect::<Result<_, _>>()
    .unwrap_or_else(|err: BufferSizeError| {
        let larger_buf_size = 1024;
        request
            .get_header_values(&name, larger_buf_size)
            .collect::<Result<_, _>>()
            .unwrap()
    });
```

**Parameters**

- `self`: `&Self`
- `name`: `&HeaderName`
- `buf_size`: `usize`

**Returns**

`impl Iterator<Item = Result<HeaderValue, BufferSizeError>> + 'a`

### get_method

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#524

```rust
fn get_method(&self, max_length: usize) -> Result<Method, BufferSizeError>
```

Get the request method.

If the method is longer than `max_length`, this will return a [`BufferSizeError`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/error/struct.BufferSizeError/); you can
retry with a larger buffer size if necessary.

**Parameters**

- `self`: `&Self`
- `max_length`: `usize`

**Returns**

`Result<Method, BufferSizeError>`

### get_url

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#597

```rust
fn get_url(&self, max_length: usize) -> Result<Url, BufferSizeError>
```

Get the request URL.

If the URL is longer than `max_length`, this will return a [`BufferSizeError`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/error/struct.BufferSizeError/); you can
retry with a larger buffer size if necessary.

**Parameters**

- `self`: `&Self`
- `max_length`: `usize`

**Returns**

`Result<Url, BufferSizeError>`

### get_version

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#499

```rust
fn get_version(&self) -> Version
```

Get the HTTP version of this request.

**Parameters**

- `self`: `&Self`

**Returns**

`Version`

### handoff_fanout

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1049

```rust
fn handoff_fanout(&mut self, backend: &str) -> Result<(), SendErrorCause>
```

Pass the request through the Fanout GRIP proxy and on to a backend.

This can only be used on services that have the Fanout feature enabled.

The sending completes in the background. Once this method has been called, no other
response can be sent to this request, and the application can exit without affecting the
send.

**Parameters**

- `self`: `&mut Self`
- `backend`: `&str`

**Returns**

`Result<(), SendErrorCause>`

### handoff_websocket

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1028

```rust
fn handoff_websocket(&mut self, backend: &str) -> Result<(), SendErrorCause>
```

Pass the WebSocket directly to a backend.

This can only be used on services that have the WebSockets feature enabled and on requests
that are valid WebSocket requests.

The sending completes in the background. Once this method has been called, no other
response can be sent to this request, and the application can exit without affecting the
send.

**Parameters**

- `self`: `&mut Self`
- `backend`: `&str`

**Returns**

`Result<(), SendErrorCause>`

### insert_header

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#444

```rust
fn insert_header(&mut self, name: &HeaderName, value: &HeaderValue)
```

Set a request header to the given value, discarding any previous values for the given header
name.

**Parameters**

- `self`: `&mut Self`
- `name`: `&HeaderName`
- `value`: `&HeaderValue`

### into_u32

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#147

```rust
fn into_u32(self) -> u32
```

Turn a handle into its representation without closing the underlying resource.

This should only be used when calling the raw ABI directly, and care should be taken not to
reuse or alias handle values.

**Parameters**

- `self`: `Self`

**Returns**

`u32`

### is_invalid

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#102

```rust
const fn is_invalid(&self) -> bool
```

Returns `true` if the request handle is invalid.

**Parameters**

- `self`: `&Self`

**Returns**

`bool`

### is_valid

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#90

```rust
const fn is_valid(&self) -> bool
```

Returns `true` if the request handle is valid.

**Parameters**

- `self`: `&Self`

**Returns**

`bool`

### new

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#210

```rust
fn new() -> Self
```

Acquire a new request handle.

By default, the request will have a `GET` method, a URL of `/`, and empty headers.

**Returns**

`Self`

### on_behalf_of

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1004

```rust
fn on_behalf_of(&mut self, service: &str) -> Result<(), FastlyStatus>
```

Perform this send on behalf of another service, meaning that we will use that service's
cache to look up and store the result.
#### Internal / Privileged

This operation is privileged, and attempts to use this functionality without
proper privileges will cause errors. If you are interested in having two or
more of your services share the same cache, please talk to your Fastly account
representative. While we have no plans to offer this ability widely -- this
capability is only currently allowed for Fastly-internal services -- we may
revisit this decision given sufficient customer input.

**Parameters**

- `self`: `&mut Self`
- `service`: `&str`

**Returns**

`Result<(), FastlyStatus>`

### remove_header

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#482

```rust
fn remove_header(&mut self, name: &HeaderName) -> bool
```

Remove all request headers of the given name, and return whether any headers were removed.

**Parameters**

- `self`: `&mut Self`
- `name`: `&HeaderName`

**Returns**

`bool`

### send

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#670

```rust
fn send(self, body: BodyHandle, backend: &str) -> Result<(ResponseHandle, BodyHandle), SendErrorCause>
```

Retrieve a response for the request, either from cache or by sending it to the given backend
server. Returns once the response headers have been received, or an error occurs.

**Parameters**

- `self`: `Self`
- `body`: `BodyHandle`
- `backend`: `&str`

**Returns**

`Result<(ResponseHandle, BodyHandle), SendErrorCause>`

### send_async

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#791

```rust
fn send_async(self, body: BodyHandle, backend: &str) -> Result<PendingRequestHandle, SendErrorCause>
```

Send a request asynchronously via the given backend, returning as soon as the request has
begun sending.

The resulting [`PendingRequestHandle`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/) can be evaluated using
[`PendingRequestHandle::poll()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/#method-poll), [`PendingRequestHandle::wait()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/#method-wait), or
[`select_handles()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/fn.select_handles/). It can also be discarded if the
request was sent for effects it might have, and the response is unimportant.

**Parameters**

- `self`: `Self`
- `body`: `BodyHandle`
- `backend`: `&str`

**Returns**

`Result<PendingRequestHandle, SendErrorCause>`

### send_async_streaming

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#846

```rust
fn send_async_streaming(self, body: BodyHandle, backend: &str) -> Result<(StreamingBodyHandle, PendingRequestHandle), SendErrorCause>
```

Send a request asynchronously via the given backend, and return a [`StreamingBodyHandle`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.StreamingBodyHandle/) to
allow continued writes to the request body.

[`StreamingBodyHandle::finish()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.StreamingBodyHandle/#method-finish) must be called in order to finish sending the request.

**Parameters**

- `self`: `Self`
- `body`: `BodyHandle`
- `backend`: `&str`

**Returns**

`Result<(StreamingBodyHandle, PendingRequestHandle), SendErrorCause>`

### send_async_streaming_to_backend

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#877

```rust
fn send_async_streaming_to_backend(self, body: BodyHandle, backend: &Backend) -> Result<(StreamingBodyHandle, PendingRequestHandle), SendErrorCause>
```

Send a request asynchronously via the given backend, and return a [`StreamingBodyHandle`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.StreamingBodyHandle/) to
allow continued writes to the request body.

[`StreamingBodyHandle::finish()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.StreamingBodyHandle/#method-finish) must be called in order to finish sending the request.

**Parameters**

- `self`: `Self`
- `body`: `BodyHandle`
- `backend`: `&Backend`

**Returns**

`Result<(StreamingBodyHandle, PendingRequestHandle), SendErrorCause>`

### send_async_to_backend

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#822

```rust
fn send_async_to_backend(self, body: BodyHandle, backend: &Backend) -> Result<PendingRequestHandle, SendErrorCause>
```

Send a request asynchronously via the given backend, returning as soon as the request has
begun sending.

The resulting [`PendingRequestHandle`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/) can be evaluated using
[`PendingRequestHandle::poll()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/#method-poll), [`PendingRequestHandle::wait()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/#method-wait), or
[`select_handles()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/fn.select_handles/). It can also be discarded if the
request was sent for effects it might have, and the response is unimportant.

**Parameters**

- `self`: `Self`
- `body`: `BodyHandle`
- `backend`: `&Backend`

**Returns**

`Result<PendingRequestHandle, SendErrorCause>`

### send_to_backend

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#699

```rust
fn send_to_backend(self, body: BodyHandle, backend: &Backend) -> Result<(ResponseHandle, BodyHandle), SendErrorCause>
```

Retrieve a response for the request, either from cache or by sending it to the given backend
server. Returns once the response headers have been received, or an error occurs.

**Parameters**

- `self`: `Self`
- `body`: `BodyHandle`
- `backend`: `&Backend`

**Returns**

`Result<(ResponseHandle, BodyHandle), SendErrorCause>`

### server_ip_addr

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1117

```rust
fn server_ip_addr(&self) -> Option<IpAddr>
```

Returns the IP address on which this server received the HTTP request.

**Parameters**

- `self`: `&Self`

**Returns**

`Option<IpAddr>`

### set_auto_decompress_response

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#986

```rust
fn set_auto_decompress_response(&mut self, content_encodings: ContentEncodings)
```

Set the content encodings to automatically decompress responses to this request.

If the response to this request is encoded by one of the encodings set by this method, the
response will be presented to the Compute program in decompressed form with the
`Content-Encoding` and `Content-Length` headers removed.

**Parameters**

- `self`: `&mut Self`
- `content_encodings`: `ContentEncodings`

### set_cache_override

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#943

```rust
fn set_cache_override(&mut self, cache_override: &CacheOverride)
```

Set the cache override behavior for this request.

This setting will override any cache directive headers returned in response to this request.
Note that stale_if_error is not overridden by this mechanism.

**Parameters**

- `self`: `&mut Self`
- `cache_override`: `&CacheOverride`

### set_framing_headers_mode

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#995

```rust
fn set_framing_headers_mode(&mut self, mode: FramingHeadersMode)
```

Sets the way that framing headers are determined for this request.

**Parameters**

- `self`: `&mut Self`
- `mode`: `FramingHeadersMode`

### set_header_values

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#382

```rust
fn set_header_values<'a, I>(&mut self, name: &HeaderName, values: I)
where
    I: IntoIterator<Item = &'a HeaderValue>,
```

Set the values for the given header name, replacing any headers that previously existed for
that name.

**Parameters**

- `self`: `&mut Self`
- `name`: `&HeaderName`
- `values`: `I`

### set_method

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#580

```rust
fn set_method(&self, method: &Method)
```

Set the request method.

**Parameters**

- `self`: `&Self`
- `method`: `&Method`

### set_url

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#658

```rust
fn set_url(&mut self, url: &Url)
```

Set the request URL.

**Parameters**

- `self`: `&mut Self`
- `url`: `&Url`

### set_version

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#512

```rust
fn set_version(&mut self, v: Version)
```

Set the HTTP version of this request.

**Parameters**

- `self`: `&mut Self`
- `v`: `Version`

## Trait implementations

### impl Debug for RequestHandle

#### fmt

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#56

```rust
fn fmt(&self, f: &mut Formatter<'_>) -> Result
```

**Parameters**

- `self`: `&Self`
- `f`: `&mut $crate::fmt::Formatter`

**Returns**

`$crate::fmt::Result`

### impl Drop for RequestHandle

#### drop

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#1541

```rust
fn drop(&mut self)
```

**Parameters**

- `self`: `&mut Self`

### impl Hash for RequestHandle

#### hash

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#57

```rust
fn hash<__H: Hasher>(&self, state: &mut __H)
```

**Parameters**

- `self`: `&Self`
- `state`: `&mut __H`

### impl PartialEq for RequestHandle

#### eq

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/request/handle.rs#57

```rust
fn eq(&self, other: &Self) -> bool
```

**Parameters**

- `self`: `&Self`
- `other`: `&Self`

**Returns**

`bool`

### impl RequestHandleCacheKey for RequestHandle

#### set_cache_key

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/experimental.rs#212

```rust
fn set_cache_key(&mut self, key: impl AsRef<[u8]>)
```

Set the cache key to be used when attempting to satisfy this request from a cached response.
#### Stability

This is part of an experimental API that is subject to change or removal even in minor versions of
this crate.

**Parameters**

- `self`: `&mut Self`
- `key`: `impl AsRef<[u8]>`

### impl RequestHandleUpgradeWebsocket for RequestHandle

#### handoff_fanout

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/experimental.rs#353

```rust
fn handoff_fanout(&mut self, backend: &str) -> Result<(), SendErrorCause>
```

Pass the request through the Fanout GRIP proxy and on to a backend.

This can only be used on services that have the Fanout feature enabled.

The sending completes in the background. Once this method has been called, no other
response can be sent to this request, and the application can exit without affecting the
send.

**Parameters**

- `self`: `&mut Self`
- `backend`: `&str`

**Returns**

`Result<(), SendErrorCause>`

#### handoff_websocket

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/experimental.rs#332

```rust
fn handoff_websocket(&mut self, backend: &str) -> Result<(), SendErrorCause>
```

Pass the WebSocket directly to a backend.

This can only be used on services that have the WebSockets feature enabled and on requests
that are valid WebSocket requests.

The sending completes in the background. Once this method has been called, no other
response can be sent to this request, and the application can exit without affecting the
send.

**Parameters**

- `self`: `&mut Self`
- `backend`: `&str`

**Returns**

`Result<(), SendErrorCause>`

## Auto trait implementations

- `Freeze`
- `RefUnwindSafe`
- `Send`
- `Sync`
- `Unpin`
- `UnsafeUnpin`
- `UnwindSafe`

## Blanket implementations

- `Any`
- `Borrow<T>`
- `BorrowMut<T>`
- `Downcast`
- `DowncastSync`
- `Equivalent<K>`
- `ErasedDestructor`
- `From<T>`
- `Into<U>`
- `IntoEither`
- `Same`
- `TryFrom<U>`
- `TryInto<U>`
