Sha256: efe1cfb661c32357136e8cefe2d54ad4598c780224babfb7c0b255707e69d8fa

Contents?: true

Size: 851 Bytes

Versions: 1

Compression:

Stored size: 851 Bytes

Contents

require 'http/version'

require 'http/chainable'
require 'http/client'
require 'http/mime_type'
require 'http/options'
require 'http/request'
require 'http/response'
require 'http/uri_backport' if RUBY_VERSION < "1.9.0"

# THIS IS ENTIRELY TEMPORARY, I ASSURE YOU
require 'net/https'
require 'uri'
require 'certified'

# Http, it can be simple!
module Http
  extend Chainable

  # The method given was not understood
  class UnsupportedMethodError < ArgumentError; end

  # Valid HTTP methods
  METHODS = [:get, :head, :post, :put, :delete, :trace, :options, :connect, :patch]

  # Matches HTTP header names when in "Canonical-Http-Format"
  CANONICAL_HEADER = /^[A-Z][a-z]*(-[A-Z][a-z]*)*$/

  # Transform to canonical HTTP header capitalization
  def self.canonicalize_header(header)
    header.to_s.split('-').map(&:capitalize).join('-')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
http-0.2.0 lib/http.rb