class HTTP::Request

Overview

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"

Defined in:

core_ext/http_request.cr

Instance Method Summary

Instance Method Detail

def authority : String | Nil #

[View source]
def hostname : String | Nil #

Extracts the hostname from Host header.

Returns nil if the Host header is missing.

If the Host header contains a port number, it is stripped off.


[View source]
def keep_alive? #

[View source]
def scheme : String | Nil #

[View source]