Method: Behance::Client#request

Defined in:
lib/behance/client.rb

#request(path, options = {}) ⇒ Object

Public: Makes a http request to the API.

path - A String that represents the endpoint path. options - Hash of parameters to pass along.

Examples

request("users/1")
request("projects", page: 2)

Returns a response body from the API.



55
56
57
58
59
60
61
62
63
64
# File 'lib/behance/client.rb', line 55

def request(path, options={})
  response = @connection.get do |req|
    req.url path
    req.params[:api_key] = @access_token
    options.each do |key, val|
      req.params[key] = val
    end
  end
  response.body
end