def request method, path, opts={}
      conn_options = connection_options opts
      opts['api_key'] = api_key unless opts.has_key? 'api_key'
      opts['file_type'] = file_type unless opts.has_key? 'file_type'

      response = connection(conn_options).send(method) do |request|
        case method
        when :get
          request.url path, opts
        when :delete
          request.url path, opts
        when :patch, :post, :put
          if conn_options[:force_urlencoded]
            request.url path, opts
          else
            request.path = path
            request.body = MultiJson.dump(opts) unless opts.empty?
          end
        end
      end

      response
    end
def request method, path, opts={}
      conn_options = connection_options opts
      opts['api_key'] = api_key unless opts.has_key? 'api_key'
      opts['file_type'] = file_type unless opts.has_key? 'file_type'

      response = connection(conn_options).send(method) do |request|
        case method
        when :get
          request.url path, opts
        when :delete
          request.url path, opts
        when :patch, :post, :put
          if conn_options[:force_urlencoded]
            request.url path, opts
          else
            request.path = path
            request.body = MultiJson.dump(opts) unless opts.empty?
          end
        end
      end

      response
    end
Perform a request

 @param method [String] Type of request path
 @param path [String] URL path to send request
 @param opts [Hash] Request parameters
 @return [Hashie::Mash] Response