Class: RestClient::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/restclient_ext/request.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.execute_options(args, &block) ⇒ Object



3
4
5
# File 'lib/restclient_ext/request.rb', line 3

def self.execute_options(args, &block)
  new(args).execute_options(&block)
end

Instance Method Details

#execute_options(&block) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/restclient_ext/request.rb', line 7

def execute_options(&block)
  uri = parse_url_with_auth(url)
  http_request = Net::HTTPGenericRequest.new(method.to_s.upcase, false, true, uri.request_uri, processed_headers)

  transmit uri, http_request, payload, & block
ensure
  payload.close if payload
end