Method: EasyPost::Client#make_request
- Defined in:
- lib/easypost/client.rb
#make_request(method, endpoint, body = nil, api_version = EasyPost::InternalUtilities::Constants::API_VERSION) ⇒ Hash
Make an HTTP request
79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/easypost/client.rb', line 79 def make_request( method, endpoint, body = nil, api_version = EasyPost::InternalUtilities::Constants::API_VERSION ) response = @http_client.request(method, endpoint, nil, body, api_version) potential_error = EasyPost::Errors::ApiError.handle_api_error(response) raise potential_error unless potential_error.nil? EasyPost::InternalUtilities::Json.parse_json(response.body) end |