Fastly Compute C++ SDK
Loading...
Searching...
No Matches

#include <request.h>

Public Member Functions

 Request (Method method, std::string_view url)
bool is_from_client ()
Request clone_without_body ()
Request clone_with_body ()
fastly::expected< Responsesend (fastly::backend::Backend &backend)
fastly::expected< Responsesend (std::string_view backend_name)
fastly::expected< request::PendingRequestsend_async (fastly::backend::Backend &backend)
fastly::expected< request::PendingRequestsend_async (std::string_view backend_name)
fastly::expected< std::pair< StreamingBody, request::PendingRequest > > send_async_streaming (fastly::backend::Backend &backend)
fastly::expected< std::pair< StreamingBody, request::PendingRequest > > send_async_streaming (std::string_view backend_name)
Request with_body (Body body) &&
 Builder-style equivalent of Request::set_body().
bool has_body ()
 Returns true if this request has a body.
Body take_body ()
void set_body (Body body)
 Set the given value as the request's body.
void append_body (Body &body)
std::vector< uint8_t > into_body_bytes ()
 Consume the request and return its body as a byte vector.
std::string into_body_string ()
 Consume the request and return its body as a string.
Body into_body ()
 Consume the request and return its body as a Body instance.
fastly::expected< Requestwith_body_text_plain (std::string_view body) &&
fastly::expected< void > set_body_text_plain (std::string_view body)
fastly::expected< Requestwith_body_text_html (std::string_view body) &&
fastly::expected< void > set_body_text_html (std::string_view body)
std::string take_body_string ()
Request with_body_octet_stream (std::vector< uint8_t > body) &&
void set_body_octet_stream (std::vector< uint8_t > body)
std::vector< uint8_t > take_body_bytes ()
std::optional< std::string > get_content_type ()
Request with_content_type (std::string_view mime) &&
void set_content_type (std::string_view mime)
std::optional< size_t > get_content_length ()
fastly::expected< bool > contains_header (std::string_view name)
 Returns whether the given header name is present in the request.
fastly::expected< Requestwith_header (std::string_view name, std::string_view value) &&
 Builder-style equivalent of Request::append_header().
fastly::expected< Requestwith_set_header (std::string_view name, std::string_view value) &&
 Builder-style equivalent of Request::set_header().
fastly::expected< std::optional< HeaderValue > > get_header (std::string_view name)
fastly::expected< HeaderValuesRangeget_header_all (std::string_view name)
 Get an iterator of all the values of a header.
fastly::expected< HeadersRangeget_headers ()
fastly::expected< HeaderNamesRangeget_header_names ()
fastly::expected< void > set_header (std::string_view name, std::string_view value)
fastly::expected< void > append_header (std::string_view name, std::string_view value)
fastly::expected< std::optional< std::string > > remove_header (std::string_view name)
Request with_method (Method method) &&
 Builder-style equivalent of Request::set_method().
Method get_method ()
 Get the request method.
void set_method (Method method)
 Set the request method.
fastly::expected< Requestwith_url (std::string_view url) &&
 Builder-style equivalent of Request::set_url().
std::string get_url ()
 Get the request URL as a string.
fastly::expected< void > set_url (std::string_view url)
 Set the request URL.
std::string get_path ()
fastly::expected< Requestwith_path (std::string_view path) &&
 Builder-style equivalent of Request::set_path().
fastly::expected< void > set_path (std::string_view path)
std::optional< std::string > get_query_string ()
std::optional< std::string > get_query_parameter (std::string_view param)
fastly::expected< Requestwith_query_string (std::string_view query) &&
 Builder-style equivalent of Request::set_query().
fastly::expected< void > set_query_string (std::string_view query)
void remove_query ()
 Remove the query component from the request URL, if one exists.
Request with_version (Version version) &&
 Builder-style equivalent of Request::set_version().
Version get_version ()
 Get the HTTP version of this request.
void set_version (Version version)
 Set the HTTP version of this request.
Request with_pass (bool pass) &&
 Builder-style equivalent of Request::set_pass().
void set_pass (bool pass)
Request with_ttl (uint32_t ttl) &&
 Builder-style equivalent of Request::set_ttl().
void set_ttl (uint32_t ttl)
Request with_stale_while_revalidate (uint32_t swr) &&
void set_stale_while_revalidate (uint32_t swr)
Request with_pci (bool pci) &&
 Builder-style equivalent of Request::set_pci().
void set_pci (bool pci)
fastly::expected< Requestwith_surrogate_key (std::string_view sk) &&
fastly::expected< void > set_surrogate_key (std::string_view sk)
std::optional< std::string > get_client_ip_addr ()
std::optional< std::string > get_server_ip_addr ()
std::optional< OriginalHeaderNamesRangeget_original_header_names ()
std::optional< uint32_t > get_original_header_count ()
std::optional< bool > get_client_ddos_detected ()
void set_auto_decompress_gzip (bool gzip)
Request with_auto_decompress_gzip (bool gzip) &&
bool fastly_key_is_valid ()
void set_cache_key (std::string_view key)
void set_cache_key (std::vector< uint8_t > key)
Request with_cache_key (std::string_view key) &&
 Builder-style equivalent of Request::set_cache_key().
Request with_cache_key (std::vector< uint8_t > key) &&
 Builder-style equivalent of Request::set_cache_key().
bool is_cacheable ()
 Gets whether the request is potentially cacheable.

Static Public Member Functions

static Request get (std::string_view url)
static Request head (std::string_view url)
static Request post (std::string_view url)
static Request put (std::string_view url)
static Request delete_ (std::string_view url)
static Request connect (std::string_view url)
static Request options (std::string_view url)
static Request trace (std::string_view url)
static Request patch (std::string_view url)
static Request from_client ()

Detailed Description

An HTTP request, including body, headers, method, and URL.

Getting the client request

Call Request::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 the Request() constructor. In addition, there are convenience constructors like Request::get() which automatically select the appropriate method.

Sending backend requests

Requests can be sent to a backend in blocking or asynchronous fashion using Request::send(), Request::send_async(), or Request::send_async_streaming().

Builder-style methods

Request can be used as a builder allowing requests to be constructed and used through method chaining. Methods with the with_ name prefix, such as Request::with_header(), return a moved Request to allow chaining. The builder style is typically most useful when constructing and using a request in a single expression.

For example:

Request::get("https://example.com")
.with_header("my-header", "hello!")
.with_header("my-other-header", "Здравствуйте!")
.send("example_backend");
static Request get(std::string_view url)
fastly::expected< Request > with_header(std::string_view name, std::string_view value) &&
Builder-style equivalent of Request::append_header().

Setter methods

Setter methods, such as Request::set_header(), are prefixed by set_, and can be used interchangeably with the builder-style methods, allowing you to mix and match styles based on what is most convenient for your program. Setter methods tend to work better than builder-style methods when constructing a request involves conditional branches or loops.

For example:

auto req{Request::get("https://example.com").with_header("my-header",
"hello!")};
if (needs_translation) {
req.set_header("my-other-header", "Здравствуйте!");
}
req.send("example_backend");
Examples
esi.cpp.

Constructor & Destructor Documentation

◆ Request()

fastly::http::Request::Request ( Method method,
std::string_view url )

Create a new request with the given method and URL, no headers, and an empty body.

Member Function Documentation

◆ append_body()

void fastly::http::Request::append_body ( Body & body)

Append another [Body] to the body of this request without reading or writing any body contents.

If this request does not have a body, the appended body is set as the request's body.

This method should be used when combining bodies that have not necessarily been read yet, such as the body of the client. To append contents that are already in memory as strings or bytes, you should instead use [get_body_mut()][Self::get_body_mut()] to write the contents to the end of the body.

Examples

auto req{Request::post("https://example.com").with_body("hello! client
says: ")}; req.append_body(Request::from_client().into_body());
req.send("example_backend");
static Request from_client()
static Request post(std::string_view url)
Body into_body()
Consume the request and return its body as a Body instance.
Request with_body(Body body) &&
Builder-style equivalent of Request::set_body().

◆ append_header()

fastly::expected< void > fastly::http::Request::append_header ( std::string_view name,
std::string_view value )

Add a request header with given value.

Unlike Request::set_header(), this does not discard existing values for the same header name.

◆ clone_with_body()

Request fastly::http::Request::clone_with_body ( )

Clone this request by reading in its body, and then writing the same body to the original and the cloned request.

This method requires mutable access to this request because reading from and writing to the body can involve an HTTP connection.

◆ clone_without_body()

Request fastly::http::Request::clone_without_body ( )

Make a new request with the same method, url, headers, and version of this request, but no body.

If you also need to clone the request body, use [clone_with_body()][Self::clone_with_body()]

Examples

auto original = Request::post("https://example.com")
.with_header("hello", "world!")
.with_body("hello");
auto new_req = original.clone_without_body();
assert(original.get_method() == new.get_method());
assert(original.get_url() == new.get_url());
assert(original.get_header("hello") == new.get_header("hello"));
assert(original.has_body());
assert(!new.has_body());
bool has_body()
Returns true if this request has a body.
Examples
esi.cpp.

◆ connect()

Request fastly::http::Request::connect ( std::string_view url)
static

Create a new CONNECT Request with the given URL, no headers, and an empty body.

◆ contains_header()

fastly::expected< bool > fastly::http::Request::contains_header ( std::string_view name)

Returns whether the given header name is present in the request.

◆ delete_()

Request fastly::http::Request::delete_ ( std::string_view url)
static

Create a new DELETE Request with the given URL, no headers, and an empty body.

◆ fastly_key_is_valid()

bool fastly::http::Request::fastly_key_is_valid ( )

Returns whether or not the client request had a Fastly-Key header which is valid for purging content for the service.

This function ignores the current value of any Fastly-Key header for this request.

◆ from_client()

Request fastly::http::Request::from_client ( )
static

Get 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 or by the low-level handle API.

Examples
esi.cpp.

◆ get()

Request fastly::http::Request::get ( std::string_view url)
static

Create a new GET Request with the given URL, no headers, and an empty body.

◆ get_client_ddos_detected()

std::optional< bool > fastly::http::Request::get_client_ddos_detected ( )

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

Returns std::nullopt if this is not the client request.

◆ get_client_ip_addr()

std::optional< std::string > fastly::http::Request::get_client_ip_addr ( )

◆ get_content_length()

std::optional< size_t > fastly::http::Request::get_content_length ( )

Get the value of the request's Content-Length header, if it exists.

◆ get_content_type()

std::optional< std::string > fastly::http::Request::get_content_type ( )

Get the MIME type described by the request's Content-Type header, or std::nullopt if that header is absent or contains an invalid MIME type.

◆ get_header()

fastly::expected< std::optional< HeaderValue > > fastly::http::Request::get_header ( std::string_view name)

Get the value of a header as a string, or std::nullopt if the header is not present.

If there are multiple values for the header, only one is returned, which may be any of the values. See Request::get_header_all() all of the values.

◆ get_header_all()

fastly::expected< HeaderValuesRange > fastly::http::Request::get_header_all ( std::string_view name)

Get an iterator of all the values of a header.

◆ get_header_names()

fastly::expected< HeaderNamesRange > fastly::http::Request::get_header_names ( )

◆ get_headers()

fastly::expected< HeadersRange > fastly::http::Request::get_headers ( )

◆ get_method()

Method fastly::http::Request::get_method ( )

Get the request method.

◆ get_original_header_count()

std::optional< uint32_t > fastly::http::Request::get_original_header_count ( )

◆ get_original_header_names()

std::optional< OriginalHeaderNamesRange > fastly::http::Request::get_original_header_names ( )

◆ get_path()

std::string fastly::http::Request::get_path ( )

Get the path component of the request URL.

Examples

auto req{Request::get("https://example.com/hello#world")};
assert(req.get_path() == "/hello");

◆ get_query_parameter()

std::optional< std::string > fastly::http::Request::get_query_parameter ( std::string_view param)

Get the value of a query parameter in the request's URL.

This assumes that the query string is a & separated list of parameter=value pairs. The value of the first occurrence of parameter is returned. No URL decoding is performed.

◆ get_query_string()

std::optional< std::string > fastly::http::Request::get_query_string ( )

Get the query component of the request URL, if it exists, as a percent-encoded ASCII string.

◆ get_server_ip_addr()

std::optional< std::string > fastly::http::Request::get_server_ip_addr ( )

◆ get_url()

std::string fastly::http::Request::get_url ( )

Get the request URL as a string.

◆ get_version()

Version fastly::http::Request::get_version ( )

Get the HTTP version of this request.

◆ has_body()

bool fastly::http::Request::has_body ( )

Returns true if this request has a body.

◆ head()

Request fastly::http::Request::head ( std::string_view url)
static

Create a new HEAD Request with the given URL, no headers, and an empty body.

◆ into_body()

Body fastly::http::Request::into_body ( )

Consume the request and return its body as a Body instance.

◆ into_body_bytes()

std::vector< uint8_t > fastly::http::Request::into_body_bytes ( )

Consume the request and return its body as a byte vector.

◆ into_body_string()

std::string fastly::http::Request::into_body_string ( )

Consume the request and return its body as a string.

◆ is_cacheable()

bool fastly::http::Request::is_cacheable ( )

Gets whether the request is potentially cacheable.

◆ is_from_client()

bool fastly::http::Request::is_from_client ( )

Return true if this request is from the client of this execution of the Compute program.

◆ options()

Request fastly::http::Request::options ( std::string_view url)
static

Create a new OPTIONS Request with the given URL, no headers, and an empty body.

◆ patch()

Request fastly::http::Request::patch ( std::string_view url)
static

Create a new PATCH Request with the given URL, no headers, and an empty body.

◆ post()

Request fastly::http::Request::post ( std::string_view url)
static

Create a new POST Request with the given URL, no headers, and an empty body.

◆ put()

Request fastly::http::Request::put ( std::string_view url)
static

Create a new PUT Request with the given URL, no headers, and an empty body.

◆ remove_header()

fastly::expected< std::optional< std::string > > fastly::http::Request::remove_header ( std::string_view name)

Remove all request headers of the given name, and return one of the removed header values if any were present.

◆ remove_query()

void fastly::http::Request::remove_query ( )

Remove the query component from the request URL, if one exists.

◆ send() [1/2]

fastly::expected< Response > fastly::http::Request::send ( fastly::backend::Backend & backend)

Retrieve a reponse 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.

Examples

Sending the client request to a backend without modification:

auto backend_resp{Request::from_client().send("example_backend")};
assert(backend_resp.get_status().is_success());
fastly::expected< Response > send(fastly::backend::Backend &backend)

Sending a synthetic request:

auto
backend_resp{Request::get("https://example.com").send("example_backend")};
assert(backend_resp.get_status().is_success());
Examples
esi.cpp, and streaming_response.cpp.

◆ send() [2/2]

fastly::expected< Response > fastly::http::Request::send ( std::string_view backend_name)

◆ send_async() [1/2]

fastly::expected< request::PendingRequest > fastly::http::Request::send_async ( fastly::backend::Backend & backend)

Begin sending the request to the given backend server, and return a PendingRequest that can yield the backend response or an error.

This method returns as soon as the request begins sending to the backend, and transmission of the request body and headers will continue in the background.

This method allows for sending more than one request at once and receiving their responses in arbitrary orders. See PendingRequest for more details on how to wait on, poll, or select between pending requests.

This method is also useful for sending requests where the response is unimportant, but the request may take longer than the Compute program is able to run, as the request will continue sending even after the program that initiated it exits.

Examples

Sending a request to two backends and returning whichever response finishes first:

auto backend_resp_1{Request::get("https://example.com/")
.send_async("example_backend_1")};
auto backend_resp_2{Request::get("https://example.com/")
.send_async("example_backend_2")};
auto [selected_resp, _others] =
fastly::http::request::select({backend_resp_1, backend_resp_2});
selected_resp.send_to_client();
fastly::expected< request::PendingRequest > send_async(fastly::backend::Backend &backend)
std::pair< fastly::expected< fastly::http::Response >, std::vector< PendingRequest > > select(std::vector< PendingRequest > &reqs)

Sending a long-running request and ignoring its result so that the program can exit before it completes:

Request::post("https://example.com")
.with_body(some_large_file)
.send_async("example_backend");

◆ send_async() [2/2]

fastly::expected< request::PendingRequest > fastly::http::Request::send_async ( std::string_view backend_name)

◆ send_async_streaming() [1/2]

fastly::expected< std::pair< StreamingBody, request::PendingRequest > > fastly::http::Request::send_async_streaming ( fastly::backend::Backend & backend)

Begin sending the request to the given backend server, and return a PendingRequest that can yield the backend response or an error along with a StreamingBody that can accept further data to send.

The backend connection is only closed once StreamingBody::finish() is called. The PendingRequest will not yield a Response until the StreamingBody is finished.

This method is most useful for programs that do some sort of processing or inspection of a potentially-large client request body. Streaming allows the program to operate on small parts of the body rather than having to read it all into memory at once.

This method returns as soon as the request begins sending to the backend, and transmission of the request body and headers will continue in the background.

Examples

Count the number of lines in a UTF-8 client request body while sending it to the backend:

// Take the body so we can iterate through its lines later
auto req_body{req.take_body()};
// Start sending the client request to the client with a now-empty body
auto [backend_body, pending_req] = req
.send_async_streaming("example_backend");
size_t num_lines{0};
std::string buf;
while (std::getline(req_body, buf)) {
num_lines++;
// Write the line to the streaming backend body
backend_body << buf << "\n" << std::flush;
}
// Finish the streaming body to allow the backend connection to close
backend_body.finish();
std::cout
<< "client request body contained "
<< num_lines
<< " lines"
<< std::endl;

◆ send_async_streaming() [2/2]

fastly::expected< std::pair< StreamingBody, request::PendingRequest > > fastly::http::Request::send_async_streaming ( std::string_view backend_name)

◆ set_auto_decompress_gzip()

void fastly::http::Request::set_auto_decompress_gzip ( bool gzip)

Set whether a gzip-encoded response to this request will be automatically decompressed.

Enabling this will set the Accept-Encoding header before the request is sent, regardless of the original value in the request, to ensure that any values originally sent by a browser or other client get replaced with gzip, so that the backend will not try sending unsupported compression algorithms.

If the response to this request is gzip-encoded, it will be presented in decompressed form, and the Content-Encoding and Content-Length headers will be removed.

◆ set_body()

void fastly::http::Request::set_body ( Body body)

Set the given value as the request's body.

◆ set_body_octet_stream()

void fastly::http::Request::set_body_octet_stream ( std::vector< uint8_t > body)

Set the given bytes as the request's body with content type application/octet-stream.

◆ set_body_text_html()

fastly::expected< void > fastly::http::Request::set_body_text_html ( std::string_view body)

Set the given string as the request's body with content type text/html; / charset=UTF-8.

◆ set_body_text_plain()

fastly::expected< void > fastly::http::Request::set_body_text_plain ( std::string_view body)

Set the given string as the request's body with content type text/plain; charset=UTF-8.

◆ set_cache_key() [1/2]

void fastly::http::Request::set_cache_key ( std::string_view key)

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

◆ set_cache_key() [2/2]

void fastly::http::Request::set_cache_key ( std::vector< uint8_t > key)

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

◆ set_content_type()

void fastly::http::Request::set_content_type ( std::string_view mime)

Set the MIME type described by the request's Content-Type header.

Any existing Content-Type header values will be overwritten.

◆ set_header()

fastly::expected< void > fastly::http::Request::set_header ( std::string_view name,
std::string_view value )

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

◆ set_method()

void fastly::http::Request::set_method ( Method method)

Set the request method.

◆ set_pass()

void fastly::http::Request::set_pass ( bool pass)

Set whether this request should be cached if sent to a backend.

By default this is false, which means the backend will only be reached if a cached response is not available. Set this to true to send the request directly to the backend without caching.

Overrides

Setting this to true overrides any other custom caching behaviors for this request, such as Request::set_ttl() or Request::set_surrogate_key().

◆ set_path()

fastly::expected< void > fastly::http::Request::set_path ( std::string_view path)

Set the path component of the request URL.

Examples

auto req{Request::get("https://example.com/")};
req.set_path("/hello");
assert!(req.get_url(), "https://example.com/hello");

◆ set_pci()

void fastly::http::Request::set_pci ( bool pci)

Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching.

By default, this is false, which means the request may not be PCI/HIPAA-compliant. Set it to true to enable compliant caching.

See the Fastly PCI-Compliant Caching and Delivery documentation for details.

Overrides

This sets the Request::set_pass() behavior to false.

◆ set_query_string()

fastly::expected< void > fastly::http::Request::set_query_string ( std::string_view query)

Set the query string of the request URL query component to the given string, performing percent-encoding if necessary.

Examples

_run
auto req{Request::get("https://example.com/foo")};
req.set_query_string("hello=🌐!&bar=baz");
assert(req.get_url(),
"https://example.com/foo?hello=%F0%9F%8C%90!&bar=baz");

◆ set_stale_while_revalidate()

void fastly::http::Request::set_stale_while_revalidate ( uint32_t swr)

Override the caching behavior of this request to use the given stale-while-revalidate time, in seconds.

Overrides

This overrides the behavior specified in the response headers, and sets the Request::set_pass() behavior to false.

◆ set_surrogate_key()

fastly::expected< void > fastly::http::Request::set_surrogate_key ( std::string_view sk)

Override the caching behavior of this request to include the given surrogate key(s), provided as a header value.

The header value can contain more than one surrogate key, separated by spaces.

Surrogate keys must contain only printable ASCII characters (those between 0x21 and 0x7E, inclusive). Any invalid keys will be ignored.

See the Fastly surrogate keys guide for details.

Overrides

This sets the Request::set_pass() behavior to false, and extends (but does not replace) any Surrogate-Key response headers from the backend.

◆ set_ttl()

void fastly::http::Request::set_ttl ( uint32_t ttl)

Override the caching behavior of this request to use the given Time to Live (TTL), in seconds.

Overrides

This overrides the behavior specified in the response headers, and sets the Request::set_pass() behavior to false.

◆ set_url()

fastly::expected< void > fastly::http::Request::set_url ( std::string_view url)

Set the request URL.

◆ set_version()

void fastly::http::Request::set_version ( Version version)

Set the HTTP version of this request.

◆ take_body()

Body fastly::http::Request::take_body ( )

Take and return the body from this request.

After calling this method, this request will no longer have a body.

◆ take_body_bytes()

std::vector< uint8_t > fastly::http::Request::take_body_bytes ( )

Take and return the body from this request as a vector of bytes.

After calling this method, this request will no longer have a body.

◆ take_body_string()

std::string fastly::http::Request::take_body_string ( )

Take and return the body from this request as a string.

After calling this method, this request will no longer have a body.

◆ trace()

Request fastly::http::Request::trace ( std::string_view url)
static

Create a new TRACE Request with the given URL, no headers, and an empty body.

◆ with_auto_decompress_gzip()

Request fastly::http::Request::with_auto_decompress_gzip ( bool gzip) &&

Builder-style equivalent of Request::set_auto_decompress_gzip().

Examples
esi.cpp.

◆ with_body()

Request fastly::http::Request::with_body ( Body body) &&

Builder-style equivalent of Request::set_body().

◆ with_body_octet_stream()

Request fastly::http::Request::with_body_octet_stream ( std::vector< uint8_t > body) &&

Builder-style equivalent of Request::set_body_octet_stream().

◆ with_body_text_html()

fastly::expected< Request > fastly::http::Request::with_body_text_html ( std::string_view body) &&

Builder-style equivalent of Request::set_body_text_html().

◆ with_body_text_plain()

fastly::expected< Request > fastly::http::Request::with_body_text_plain ( std::string_view body) &&

Builder-style equivalent of Request::set_body_text_plain().

◆ with_cache_key() [1/2]

Request fastly::http::Request::with_cache_key ( std::string_view key) &&

Builder-style equivalent of Request::set_cache_key().

◆ with_cache_key() [2/2]

Request fastly::http::Request::with_cache_key ( std::vector< uint8_t > key) &&

Builder-style equivalent of Request::set_cache_key().

◆ with_content_type()

Request fastly::http::Request::with_content_type ( std::string_view mime) &&

Builder-style equivalent of Request::set_content_type().

◆ with_header()

fastly::expected< Request > fastly::http::Request::with_header ( std::string_view name,
std::string_view value ) &&

Builder-style equivalent of Request::append_header().

◆ with_method()

Request fastly::http::Request::with_method ( Method method) &&

Builder-style equivalent of Request::set_method().

◆ with_pass()

Request fastly::http::Request::with_pass ( bool pass) &&

Builder-style equivalent of Request::set_pass().

◆ with_path()

fastly::expected< Request > fastly::http::Request::with_path ( std::string_view path) &&

Builder-style equivalent of Request::set_path().

◆ with_pci()

Request fastly::http::Request::with_pci ( bool pci) &&

Builder-style equivalent of Request::set_pci().

◆ with_query_string()

fastly::expected< Request > fastly::http::Request::with_query_string ( std::string_view query) &&

Builder-style equivalent of Request::set_query().

◆ with_set_header()

fastly::expected< Request > fastly::http::Request::with_set_header ( std::string_view name,
std::string_view value ) &&

Builder-style equivalent of Request::set_header().

◆ with_stale_while_revalidate()

Request fastly::http::Request::with_stale_while_revalidate ( uint32_t swr) &&

Builder-style equivalent of Request::set_stale_while_revalidate().

◆ with_surrogate_key()

fastly::expected< Request > fastly::http::Request::with_surrogate_key ( std::string_view sk) &&

Builder-style equivalent of Request::set_surrogate_key().

◆ with_ttl()

Request fastly::http::Request::with_ttl ( uint32_t ttl) &&

Builder-style equivalent of Request::set_ttl().

◆ with_url()

fastly::expected< Request > fastly::http::Request::with_url ( std::string_view url) &&

Builder-style equivalent of Request::set_url().

◆ with_version()

Request fastly::http::Request::with_version ( Version version) &&

Builder-style equivalent of Request::set_version().


The documentation for this class was generated from the following file: