module Github::Request

def request(method, path, params, options)

def request(method, path, params, options)
  if !METHODS.include?(method)
    raise ArgumentError, "unkown http method: #{method}"
  end
  _extract_mime_type(params, options)
  puts "EXECUTED: #{method} - #{path} with #{params} and #{options}" if ENV['DEBUG']
  response = connection(options).send(method) do |request|
    case method.to_sym
    when *(METHODS - METHODS_WITH_BODIES)
      request.url(path, params)
    when *METHODS_WITH_BODIES
      request.path = path
      request.body = MultiJson.dump(_process_params(params)) unless params.empty?
    end
  end
  response.body
end