def perform(method, endpoint, query={})
      request_options = build_request(method, query)
      yield request_options if block_given?

      request = Excon.new(endpoint)
      request.request(request_options)
    end
def perform(method, endpoint, query={})
      request_options = build_request(method, query)
      yield request_options if block_given?

      request = Excon.new(endpoint)
      request.request(request_options)
    end
Public: Initialize a new request to the API.

 token     - The API token for Diffbot.
 test_mode - Whether requests are in test mode or not. This is passed to
             Excon so we can mock connections.
 Public: Perform an HTTP request against Diffbot's API.

 method   - The request method, one of :get, :head, :post, :put, or
            :delete.
 endpoint - The URL to which we'll make the request, as a String.
 query    - A hash of query string params we want to pass along.

 Yields the request hash before making the request.

 Returns the response.