Module: Http

Extended by:
Chainable
Defined in:
lib/http.rb,
lib/http/client.rb,
lib/http/options.rb,
lib/http/request.rb,
lib/http/version.rb,
lib/http/response.rb,
lib/http/chainable.rb,
lib/http/mime_type.rb

Overview

Http, it can be simple!

Defined Under Namespace

Modules: Chainable Classes: Client, MimeType, Options, Request, Response, UnsupportedMethodError

Constant Summary collapse

METHODS =

Valid HTTP methods

[:get, :head, :post, :put, :delete, :trace, :options, :connect, :patch]
CANONICAL_HEADER =

Matches HTTP header names when in “Canonical-Http-Format”

/^[A-Z][a-z]*(-[A-Z][a-z]*)*$/
VERSION =
"0.2.0"

Class Method Summary collapse

Methods included from Chainable

accept, connect, default_callbacks, default_callbacks=, default_headers, default_headers=, default_options, default_options=, delete, get, head, on, options, patch, post, put, request, trace, with_headers

Class Method Details

.canonicalize_header(header) ⇒ Object

Transform to canonical HTTP header capitalization



30
31
32
# File 'lib/http.rb', line 30

def self.canonicalize_header(header)
  header.to_s.split('-').map(&:capitalize).join('-')
end