pub struct Request {
pub remote_addr: SocketAddr,
pub method: String,
pub url: Url,
pub headers: HeaderList,
pub cookies: HashMap<String, String>,
pub content_type: ContentType,
pub expect_continue: bool,
pub chunked: bool,
pub gzip: bool,
pub content_length: Option<u64>,
pub body: RequestBody,
}
Fields§
§remote_addr: SocketAddr
§method: String
§url: Url
§headers: HeaderList
§content_type: ContentType
§expect_continue: bool
§chunked: bool
§gzip: bool
§content_length: Option<u64>
§body: RequestBody
Implementations§
Source§impl Request
impl Request
pub fn body(&self) -> &RequestBody
pub fn content_type(&self) -> &ContentType
Sourcepub fn method(&self) -> &str
pub fn method(&self) -> &str
Examples found in repository?
More examples
Sourcepub fn url(&self) -> &Url
pub fn url(&self) -> &Url
Examples found in repository?
More examples
Sourcepub fn recv_body(self, max_len: u64) -> Result<Request, Response>
pub fn recv_body(self, max_len: u64) -> Result<Request, Response>
§Errors
Returns an error when the request body length is known and it is larger than max_len
.
When the request body is not known, this returns Response::get_body_and_reprocess(max_len)
.
The server then tries to read the request body.
If it reads more than max_len
bytes, it stops and returns 413 Payload Too Large
.
Trait Implementations§
impl Eq for Request
impl StructuralPartialEq for Request
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