Module: HTTPX

Extended by:
Chainable
Defined in:
lib/httpx.rb,
lib/httpx/io.rb,
lib/httpx/pool.rb,
lib/httpx/altsvc.rb,
lib/httpx/buffer.rb,
lib/httpx/errors.rb,
lib/httpx/io/ssl.rb,
lib/httpx/io/tcp.rb,
lib/httpx/io/udp.rb,
lib/httpx/headers.rb,
lib/httpx/io/unix.rb,
lib/httpx/options.rb,
lib/httpx/request.rb,
lib/httpx/session.rb,
lib/httpx/timeout.rb,
lib/httpx/version.rb,
lib/httpx/loggable.rb,
lib/httpx/registry.rb,
lib/httpx/resolver.rb,
lib/httpx/response.rb,
lib/httpx/callbacks.rb,
lib/httpx/chainable.rb,
lib/httpx/connection.rb,
lib/httpx/extensions.rb,
lib/httpx/transcoder.rb,
lib/httpx/plugins/h2c.rb,
lib/httpx/parser/http1.rb,
lib/httpx/plugins/proxy.rb,
lib/httpx/plugins/stream.rb,
lib/httpx/resolver/https.rb,
lib/httpx/plugins/cookies.rb,
lib/httpx/plugins/retries.rb,
lib/httpx/resolver/native.rb,
lib/httpx/resolver/system.rb,
lib/httpx/connection/http1.rb,
lib/httpx/connection/http2.rb,
lib/httpx/resolver/options.rb,
lib/httpx/plugins/multipart.rb,
lib/httpx/plugins/proxy/ssh.rb,
lib/httpx/plugins/persistent.rb,
lib/httpx/plugins/proxy/http.rb,
lib/httpx/plugins/compression.rb,
lib/httpx/plugins/proxy/socks4.rb,
lib/httpx/plugins/proxy/socks5.rb,
lib/httpx/plugins/push_promise.rb,
lib/httpx/plugins/authentication.rb,
lib/httpx/resolver/resolver_mixin.rb,
lib/httpx/plugins/compression/gzip.rb,
lib/httpx/plugins/follow_redirects.rb,
lib/httpx/plugins/compression/brotli.rb,
lib/httpx/plugins/compression/deflate.rb,
lib/httpx/plugins/basic_authentication.rb,
lib/httpx/plugins/digest_authentication.rb

Overview

Top-Level Namespace

Defined Under Namespace

Modules: AltSvc, Callbacks, Chainable, CurryMethods, IO, LiteralStringExtensions, Loggable, NegMethods, Parser, Plugins, PosMethods, Registry, Resolver, Transcoder, URIExtensions Classes: Buffer, Connection, ContentType, ErrorResponse, Headers, Options, Pool, ProxySSL, Request, Response, SSL, Selector, Session, TCP, Timeout, UDP, UNIX

Constant Summary collapse

Error =
Class.new(StandardError)
UnsupportedSchemeError =
Class.new(Error)
TimeoutError =
Class.new(Error) do
  attr_reader :timeout

  def initialize(timeout, message)
    @timeout = timeout
    super(message)
  end

  def to_connection_error
    ex = ConnectTimeoutError.new(@timeout, message)
    ex.set_backtrace(backtrace)
    ex
  end
end
TotalTimeoutError =
Class.new(TimeoutError)
ConnectTimeoutError =
Class.new(TimeoutError)
ResolveError =
Class.new(Error)
NativeResolveError =
Class.new(ResolveError) do
  attr_reader :connection, :host
  def initialize(connection, host, message = "Can't resolve #{host}")
    @connection = connection
    @host = host
    super(message)
  end
end
HTTPError =
Class.new(Error) do
  attr_reader :response

  def initialize(response)
    @response = response
    super("HTTP Error: #{@response.status}")
  end

  def status
    @response.status
  end
end
MisdirectedRequestError =
Class.new(HTTPError)
VERSION =
"0.5.0"
InsecureRedirectError =
Class.new(Error)

Class Method Summary collapse

Methods included from Chainable

accept, headers, plugin, request, timeout, with, wrap

Class Method Details

.const_missing(const_name) ⇒ Object



50
51
52
53
54
# File 'lib/httpx.rb', line 50

def self.const_missing(const_name)
  super unless const_name == :Client
  warn "DEPRECATION WARNING: the class #{self}::Client is deprecated. Use #{self}::Session instead."
  Session
end