class Hubspot::FilesConnection

Public Class Methods

get(path, opts) click to toggle source
Calls superclass method
# File lib/hubspot/connection.rb, line 136
def get(path, opts)
  url = generate_url(path, opts)
  response = super(url, read_timeout: read_timeout(opts), open_timeout: open_timeout(opts))
  log_request_and_response url, response
  raise(Hubspot::RequestError.new(response)) unless response.success?
  response.parsed_response
end
post(path, opts) click to toggle source
Calls superclass method
# File lib/hubspot/connection.rb, line 144
def post(path, opts)
  url = generate_url(path, opts[:params])
  response = super(
    url,
    body: opts[:body],
    headers: { 'Content-Type' => 'multipart/form-data' },
    read_timeout: read_timeout(opts), open_timeout: open_timeout(opts)
  )
  log_request_and_response url, response, opts[:body]
  raise(Hubspot::RequestError.new(response)) unless response.success?

  response
end