Struct fibers_http_client::RequestBuilder [−][src]
pub struct RequestBuilder<'a, C: 'a, E = BytesEncoder, D = RemainingBytesDecoder> { /* fields omitted */ }
HTTP request builder.
This is created by calling Client::request
method.
Methods
impl<'a, C: 'a, E, D> RequestBuilder<'a, C, E, D> where
C: AcquireConnection,
E: Encode,
D: Decode,
[src]
impl<'a, C: 'a, E, D> RequestBuilder<'a, C, E, D> where
C: AcquireConnection,
E: Encode,
D: Decode,
pub fn get(
self
) -> impl Future<Item = Response<D::Item>, Error = Error>
[src]
pub fn get(
self
) -> impl Future<Item = Response<D::Item>, Error = Error>
Executes GET
request.
pub fn head(
self
) -> impl Future<Item = Response<()>, Error = Error>
[src]
pub fn head(
self
) -> impl Future<Item = Response<()>, Error = Error>
Executes HEAD
request.
pub fn delete(
self
) -> impl Future<Item = Response<D::Item>, Error = Error>
[src]
pub fn delete(
self
) -> impl Future<Item = Response<D::Item>, Error = Error>
Executes DELETE
request.
pub fn put(
self,
body: E::Item
) -> impl Future<Item = Response<D::Item>, Error = Error>
[src]
pub fn put(
self,
body: E::Item
) -> impl Future<Item = Response<D::Item>, Error = Error>
Executes PUT
request.
pub fn post(
self,
body: E::Item
) -> impl Future<Item = Response<D::Item>, Error = Error>
[src]
pub fn post(
self,
body: E::Item
) -> impl Future<Item = Response<D::Item>, Error = Error>
Executes POST
request.
pub fn header_field<N, V>(self, name: N, value: V) -> Self where
N: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
[src]
pub fn header_field<N, V>(self, name: N, value: V) -> Self where
N: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
Adds a field to the tail of the HTTP header of the request.
pub fn timeout(self, timeout: Duration) -> Self
[src]
pub fn timeout(self, timeout: Duration) -> Self
Sets the timeout of the request.
pub fn encoder<T>(self, encoder: T) -> RequestBuilder<'a, C, T, D>
[src]
pub fn encoder<T>(self, encoder: T) -> RequestBuilder<'a, C, T, D>
Sets the encoder for serializing the body of the HTTP request.
This is only meaningful at the case the method of the request is PUT
or POST
.
pub fn decoder<T>(self, decoder: T) -> RequestBuilder<'a, C, E, T>
[src]
pub fn decoder<T>(self, decoder: T) -> RequestBuilder<'a, C, E, T>
Sets the decoder for deserializing the body of the HTTP response replied from the server.
The decoder is unused if the method of the request is HEAD
.
Trait Implementations
Auto Trait Implementations
impl<'a, C, E, D> Send for RequestBuilder<'a, C, E, D> where
C: Send,
D: Send,
E: Send,
impl<'a, C, E, D> Send for RequestBuilder<'a, C, E, D> where
C: Send,
D: Send,
E: Send,
impl<'a, C, E, D> Sync for RequestBuilder<'a, C, E, D> where
C: Sync,
D: Sync,
E: Sync,
impl<'a, C, E, D> Sync for RequestBuilder<'a, C, E, D> where
C: Sync,
D: Sync,
E: Sync,