def http_request(path, params)
      token = api_key || Goodreads.configuration[:api_key]

      fail(Goodreads::ConfigurationError, "API key required.") if token.nil?

      params.merge!(format: API_FORMAT, key: token)
      url = "#{API_URL}#{path}"

      resp = RestClient.get(url, params: params) do |response, request, result, &block|
        case response.code
        when 200
          response.return!(&block)
        when 401
          fail(Goodreads::Unauthorized)
        when 403
          fail(Goodreads::Forbidden)
        when 404
          fail(Goodreads::NotFound)
        end
      end

      parse(resp)
    end
def http_request(path, params)
      token = api_key || Goodreads.configuration[:api_key]

      fail(Goodreads::ConfigurationError, "API key required.") if token.nil?

      params.merge!(format: API_FORMAT, key: token)
      url = "#{API_URL}#{path}"

      resp = RestClient.get(url, params: params) do |response, request, result, &block|
        case response.code
        when 200
          response.return!(&block)
        when 401
          fail(Goodreads::Unauthorized)
        when 403
          fail(Goodreads::Forbidden)
        when 404
          fail(Goodreads::NotFound)
        end
      end

      parse(resp)
    end
Perform an API request using API key

 path   - Request path
 params - Parameters hash