module HTTP1

Extends
Configurable

Inherited Methods

From Async::HTTP::Protocol::Configurable:

Provides HTTP/1.0 and HTTP/1.1 client and server implementations.

Classes and Modules

class Client < Connection

An HTTP/1 client connection that sends requests and reads responses.

class Connection < ::Protocol::HTTP1::Connection

An HTTP/1 connection that wraps an IO stream with version and state tracking.

class Finishable < ::Protocol::HTTP::Body::Wrapper

Keeps track of whether a body is being read, and if so, waits for it to be closed.

class Request < Protocol::Request

An incoming HTTP/1 request parsed from the connection.

class Response < Protocol::Response

An HTTP/1 response received from a server.

class Server < Connection

An HTTP/1 server connection that receives requests and sends responses.

Definitions

def self.bidirectional?

Signature

returns Boolean

Whether the protocol supports bidirectional communication.

Implementation

def self.bidirectional?
	true
end

def self.trailer?

Signature

returns Boolean

Whether the protocol supports trailers.

Implementation

def self.trailer?
	true
end

def self.client(peer, **options)

Create a client for an outbound connection.

Signature

parameter peer IO

The peer to communicate with.

parameter options Hash

Options to pass to the client instance.

Implementation

def self.client(peer, **options)
	stream = ::IO::Stream(peer)
	
	return HTTP1::Client.new(stream, VERSION, **options)
end

def self.server(peer, **options)

Create a server for an inbound connection.

Signature

parameter peer IO

The peer to communicate with.

parameter options Hash

Options to pass to the server instance.

Implementation

def self.server(peer, **options)
	stream = ::IO::Stream(peer)
	
	return HTTP1::Server.new(stream, VERSION, **options)
end

def self.names

Signature

returns Array

The names of the supported protocol.

Implementation

def self.names
	["http/1.1", "http/1.0"]
end