pub struct HttpRequest { /* private fields */ }
Expand description
Representation of an HTTP request.
Implementations§
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn new<U: AsRef<str>>(
method: Method,
url: U,
) -> Result<HttpRequest, ParseError>
pub fn new<U: AsRef<str>>( method: Method, url: U, ) -> Result<HttpRequest, ParseError>
Creates a new HTTP request.
pub fn header<K: Into<Cow<'static, str>>, V: Into<Cow<'static, str>>>( self, name: K, value: V, ) -> HttpRequest
pub fn get<U: AsRef<str>>(url: U) -> Result<HttpRequest, ParseError>
pub fn post<U: AsRef<str>, I: Into<Vec<u8>>>( url: U, body: I, ) -> Result<HttpRequest, ParseError>
pub fn addr(&self) -> Result<SocketAddr, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnwindSafe for HttpRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more