pub struct Request {
pub url: Url,
pub method: Method,
pub headers: HeaderMap,
pub params: HashMap<String, String>,
pub body: Option<Vec<u8>>,
pub client_addr: SocketAddr,
/* private fields */
}
Expand description
HTTP request
Fields§
§url: Url
URL
method: Method
Method
headers: HeaderMap
Headers
params: HashMap<String, String>
Parameters (mostly added for small-router)
body: Option<Vec<u8>>
Body
client_addr: SocketAddr
Client address
Implementations§
Source§impl Request
impl Request
Sourcepub fn with_method(method: Method) -> Self
pub fn with_method(method: Method) -> Self
Create new request with method
Sourcepub fn write_to_stream(self, stream: &mut dyn Write, keep_alive: bool)
pub fn write_to_stream(self, stream: &mut dyn Write, keep_alive: bool)
Write request to TCP stream
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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