HTTP::Request
Inherits Reference / Object
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.
NOTE: To use Request, you must explicitly import it with require "http/request"
Constructors
Class methods
get_host_from_text(text : String)
Sourceget_port_from_text(text : String) : Int32 | Nil
Sourceparse_port(text : String)
SourceInstance methods
body=(body : Nil)
Sourcecompress_type
Sourceconnect?
Sourceconnect_host
Sourceconnect_port
Sourcecontent_length
Sourceencoding?
Sourceheader_host
Sourceheader_host=(value : String)
Sourceheader_keep_alive=(value : Bool)
Sourceheader_port
Sourceregular_port
Sourceserialize_headers_and_body(io)
Sourceto_io(io, without_body : Bool)
Source