Module: HttpApiBuilder::Client::HttpRb

Defined in:
lib/http_api_builder/client/http_rb.rb

Overview

A demonstration implementation, using HTTP.rb This is functional and pretty much production ready, but you can easily rewrite it to use curb or typhoeus or anything else really

Instance Method Summary collapse

Instance Method Details

#request(verb, path, form:, query:, body:, json:) ⇒ Object

rubocop:disable Metrics/ParameterLists



9
10
11
12
# File 'lib/http_api_builder/client/http_rb.rb', line 9

def request(verb, path, form:, query:, body:, json:) # rubocop:disable Metrics/ParameterLists
  url = URI.join(self.class.base_url || '', path)
  HTTP.send(verb, url, form: form, params: query, body: body, json: json)
end