[][src]Struct conjure_runtime::RequestBuilder

pub struct RequestBuilder<'a> { /* fields omitted */ }

A builder for an asynchronous HTTP request.

Methods

impl<'a> RequestBuilder<'a>[src]

pub fn headers_mut(&mut self) -> &mut HeaderMap[src]

Returns a mutable reference to the headers of this request.

The following headers are set by default, but can be overridden:

  • Accept-Encoding: gzip, deflate
  • Accept: */*
  • User-Agent: <provided at Client construction>

The following headers are fully controlled by conjure_runtime, which will overwrite any existing value.

  • Connection
  • Content-Length
  • Content-Type
  • Host
  • Proxy-Authorization
  • X-B3-Flags
  • X-B3-ParentSpanId
  • X-B3-Sampled
  • X-B3-SpanId
  • X-B3-TraceId

pub fn bearer_token(self, token: &BearerToken) -> RequestBuilder<'a>[src]

Sets the Authorization request header to a bearer token.

This is a simple convenience wrapper.

pub fn param<T>(self, name: &str, value: T) -> RequestBuilder<'a> where
    T: ToString
[src]

Adds a parameter.

Parameters which match names in the path pattern will be treated as path parameters, and other parameters will be treated as query parameters. Only one instance of path parameters may be provided, but multiple instances of query parameters may be provided.

pub fn idempotent(self, idempotent: bool) -> RequestBuilder<'a>[src]

Sets the idempotency of the request.

Idempotent requests can be retried if an IO error is encountered.

This is by default derived from the HTTP method. GET, HEAD, OPTIONS, TRACE, PUT, and DELETE are defined as idempotent.

pub fn body<T>(self, body: T) -> RequestBuilder<'a> where
    T: Body + Sync + Send + 'a, 
[src]

Sets the request body.

pub async fn send(self) -> Result<Response, Error>[src]

Makes the request.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for RequestBuilder<'a>

impl<'a> Send for RequestBuilder<'a>

impl<'a> Sync for RequestBuilder<'a>

impl<'a> Unpin for RequestBuilder<'a>

impl<'a> !UnwindSafe for RequestBuilder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,