An HTTP request.
It serves both to perform requests by an HTTP::Client and to represent requests received by an HTTP::Server.
A request always holds an IO as a body. When creating a request with a String or Bytes its body will be a IO::Memory wrapping these, and the Content-Length header will be set appropriately.
Returns a HTTP::Request instance if successfully parsed, nil on EOF or HTTP::Status otherwise.
Returns a convenience wrapper around querying and setting cookie related headers, see HTTP::Cookies.
Returns request host from headers.
Returns request host with port from headers.
Returns the request's path component.
Sets request's path component.
Lazily parses and returns the request's query component.
Sets request's query component.
Returns a convenience wrapper around querying and setting query params, see HTTP::Params.
The network address that sent the request to an HTTP server.
The network address that sent the request to an HTTP server.
Reference
Reference
Object
Object
Returns a HTTP::Request instance if successfully parsed, nil on EOF or HTTP::Status otherwise.
Returns a convenience wrapper around querying and setting cookie related headers, see HTTP::Cookies.
Returns request host from headers.
Returns request host with port from headers.
Returns the request's path component.
Sets request's path component.
Lazily parses and returns the request's query component.
Sets request's query component.
Returns a convenience wrapper around querying and setting query params, see HTTP::Params.
The network address that sent the request to an HTTP server.
HTTP::Server will try to fill this property, and its value will have a format like "IP:port", but this format is not guaranteed. Middlewares can overwrite this value.
This property is not used by HTTP::Client.
The network address that sent the request to an HTTP server.
HTTP::Server will try to fill this property, and its value will have a format like "IP:port", but this format is not guaranteed. Middlewares can overwrite this value.
This property is not used by HTTP::Client.
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/HTTP/Request.html