Method: Faraday::Connection.get

Defined in:
lib/faraday/connection.rb

.get(url = nil, params = nil, headers = nil) {|Faraday::Request| ... } ⇒ Faraday::Response

Makes a GET HTTP request without a body.

Examples:

conn.get '/items', { page: 1 }, :accept => 'application/json'

# ElasticSearch example sending a body with GET.
conn.get '/twitter/tweet/_search' do |req|
  req.headers[:content_type] = 'application/json'
  req.params[:routing] = 'kimchy'
  req.body = JSON.generate(query: {...})
end

Parameters:

  • url (String, URI, nil) (defaults to: nil)

    The optional String base URL to use as a prefix for all requests. Can also be the options Hash.

  • params (Hash, nil) (defaults to: nil)

    Hash of URI query unencoded key/value pairs.

  • headers (Hash, nil) (defaults to: nil)

    unencoded HTTP header key/value pairs.

Yields:

Returns:



# File 'lib/faraday/connection.rb', line 129