Sha256: d2b71aef2af3c491a4d835541beae34b3b7dc2f1618a3d4215b5593f002933b0

Contents?: true

Size: 883 Bytes

Versions: 1

Compression:

Stored size: 883 Bytes

Contents

require 'uri'
require 'http/parser'
require 'http/version'

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

# HTTP should be easy
module HTTP
  extend Chainable

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

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

  class << self
    # Http[:accept => 'text/html'].get(...)
    alias_method :[], :with_headers

    # Transform to canonical HTTP header capitalization
    def canonicalize_header(header)
      header.to_s.split(/[\-_]/).map(&:capitalize).join('-')
    end
  end
end

Http = HTTP unless defined?(Http)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
http-0.5.0.pre lib/http.rb