class Quickbooks::Service::BaseService

def do_http(method, url, body, headers) # throws IntuitRequestException

throws IntuitRequestException
def do_http(method, url, body, headers) # throws IntuitRequestException
  if @oauth.nil?
    raise "OAuth client has not been initialized. Initialize with setter access_token="
  end
  unless headers.has_key?('Content-Type')
    headers['Content-Type'] = self.class::HTTP_CONTENT_TYPE
  end
  unless headers.has_key?('Accept')
    headers['Accept'] = self.class::HTTP_ACCEPT
  end
  unless headers.has_key?('Accept-Encoding')
    headers['Accept-Encoding'] = HTTP_ACCEPT_ENCODING
  end
  log_request(method, url, body, headers)
  request_info = RequestInfo.new(url, headers, body, method)
  before_request.call(request_info) if before_request
  raw_response = with_around_request(request_info) do
    case method
    when :get
      oauth_get(url, headers)
    when :post
      oauth_post(url, body, headers)
    when :upload
      oauth_post_with_multipart(url, body, headers)
    else
      raise "Do not know how to perform that HTTP operation"
    end
  end
  after_request.call(request_info, raw_response.body) if after_request
  response = Quickbooks::Service::Responses::OAuthHttpResponse.wrap(raw_response)
  log_response(response)
  check_response(response, request: body)
end