Struct HttpRequest

Source
pub struct HttpRequest(/* private fields */);
Expand description

A struct that represents an HTTP request.

Implementations§

Source§

impl HttpRequest

Source

pub fn get(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending a GET request to the specified URL.

§Arguments
  • url - The URL where the GET request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn post(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending a POST request to the specified URL.

§Arguments
  • url - The URL where the POST request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn put(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending a PUT request to the specified URL.

§Arguments
  • url - The URL where the PUT request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn delete(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending a DELETE request to the specified URL.

§Arguments
  • url - The URL where the DELETE request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn patch(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending a PATCH request to the specified URL.

§Arguments
  • url - The URL where the PATCH request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn head(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending a HEAD request to the specified URL.

§Arguments
  • url - The URL where the HEAD request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn options(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending an OPTIONS request to the specified URL.

§Arguments
  • url - The URL where the OPTIONS request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn trace(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending a TRACE request to the specified URL.

§Arguments
  • url - The URL where the TRACE request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn connect(url: Url) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending a CONNECT request to the specified URL.

§Arguments
  • url - The URL where the CONNECT request should be sent.
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Source

pub fn builder(url: Url, method: Method) -> HttpRequestBuilder

Constructs a new HttpRequestBuilder for sending an HTTP request with the specified method and URL.

§Arguments
  • url - The URL where the request should be sent.
  • method - The HTTP method to use for the request (e.g., GET, POST).
§Returns

A builder object (HttpRequestBuilder) that can be used to further customize the HTTP request before execution.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T