Module: RestApiClient::Request
- Included in:
- Client
- Defined in:
- lib/rest_api_client/request.rb
Instance Method Summary collapse
Instance Method Details
#request(method, path, body, params, opts) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rest_api_client/request.rb', line 10 def request(method, path, body, params, opts) response = connection.send(method) do | request| request.headers = request.headers.merge(opts[:headers]) if opts[:headers].present? request.path = path request.params = params if params.present? request.body = body if body.present? end puts connection.params response = Response.create(response) end |