Class Excon::Connection
In: lib/excon/connection.rb
Parent: Object

Methods

inspect   new   request   reset   retry_limit   retry_limit=  

Attributes

connection  [R] 
proxy  [R] 

Public Class methods

Initializes a new Connection instance

  @param [String] url The destination URL
  @param [Hash<Symbol, >] params One or more optional params
    @option params [String] :body Default text to be sent over a socket. Only used if :body absent in Connection#request params
    @option params [Hash<Symbol, String>] :headers The default headers to supply in a request. Only used if params[:headers] is not supplied to Connection#request
    @option params [String] :host The destination host's reachable DNS name or IP, in the form of a String
    @option params [String] :path Default path; appears after 'scheme://host:port/'. Only used if params[:path] is not supplied to Connection#request
    @option params [Fixnum] :port The port on which to connect, to the destination host
    @option params [Hash]   :query Default query; appended to the 'scheme://host:port/path/' in the form of '?key=value'. Will only be used if params[:query] is not supplied to Connection#request
    @option params [String] :scheme The protocol; 'https' causes OpenSSL to be used
    @option params [String] :proxy Proxy server; e.g. 'http://myproxy.com:8888'
    @option params [Fixnum] :retry_limit Set how many times we'll retry a failed request.  (Default 4)
    @option params [Class] :instrumentor Responds to #instrument as in ActiveSupport::Notifications
    @option params [String] :instrumentor_name Name prefix for #instrument events.  Defaults to 'excon'

Public Instance methods

Sends the supplied request to the destination host.

  @yield [chunk] @see Response#self.parse
  @param [Hash<Symbol, >] params One or more optional params, override defaults set in Connection.new
    @option params [String] :body text to be sent over a socket
    @option params [Hash<Symbol, String>] :headers The default headers to supply in a request
    @option params [String] :host The destination host's reachable DNS name or IP, in the form of a String
    @option params [String] :path appears after 'scheme://host:port/'
    @option params [Fixnum] :port The port on which to connect, to the destination host
    @option params [Hash]   :query appended to the 'scheme://host:port/path/' in the form of '?key=value'
    @option params [String] :scheme The protocol; 'https' causes OpenSSL to be used

[Validate]