Method: Cloth::Client#request
- Defined in:
- lib/cloth/client.rb
#request(method, url, options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cloth/client.rb', line 21 def request(method, url, = {}) fixed_url = url[0] == "/" ? url[1..-1] : url url = [Cloth.api_url, fixed_url].join('/') Typhoeus::Request.new( url, method: method, body: [:body], params: [:params], headers: { 'Accept': 'application/json', 'Cloth-Api-Key': @api_key, 'Content-Type': 'application/json' }.merge([:headers] || {}) ) end |