def request(request_method, path, options = {})
      check_config

      conn = Faraday.new(url: Squall.config[:base_uri]) do |c|
        c.basic_auth Squall.config[:username], Squall.config[:password]
        c.params = (options[:query] || {})
        c.request :url_encoded
        c.response :json
        c.adapter :net_http
        if Squall.config[:debug]
         c.use Faraday::Response::Logger
        end
      end

      response = conn.send(request_method, path)

      @success = (200..207).include?(response.env[:status])
      @result  = response.body
    end
def request(request_method, path, options = {})
      check_config

      conn = Faraday.new(url: Squall.config[:base_uri]) do |c|
        c.basic_auth Squall.config[:username], Squall.config[:password]
        c.params = (options[:query] || {})
        c.request :url_encoded
        c.response :json
        c.adapter :net_http
        if Squall.config[:debug]
         c.use Faraday::Response::Logger
        end
      end

      response = conn.send(request_method, path)

      @success = (200..207).include?(response.env[:status])
      @result  = response.body
    end
Public: Performs an HTTP Request

 request_method - The HTTP verb for the request, one of
                  :get/:post/:delete/:put, etc
 path           - URL path
 options        - HTTP query params

 Example

   # GET /something.json
   request :get, '/something.json'

   # PUT /something.json?something=1
   request :put, '/something.json', something: 1

 Returns the JSON response.