Module: RestClient
- Defined in:
- lib/restclient/restclient_add_timeout.rb
Overview
Make sure the rest-client won’t time out too quickly: vmc uses the rest-client for its rest calls but does not let us configure the timeouts. We monkey patch here.
Defined Under Namespace
Classes: Request
Class Attribute Summary collapse
-
.open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
.timeout ⇒ Object
Returns the value of attribute timeout.
Class Method Summary collapse
Class Attribute Details
.open_timeout ⇒ Object
Returns the value of attribute open_timeout.
10 11 12 |
# File 'lib/restclient/restclient_add_timeout.rb', line 10 def open_timeout @open_timeout end |
.timeout ⇒ Object
Returns the value of attribute timeout.
9 10 11 |
# File 'lib/restclient/restclient_add_timeout.rb', line 9 def timeout @timeout end |
Class Method Details
.post(url, payload, headers = {}, &block) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/restclient/restclient_add_timeout.rb', line 25 def self.post(url, payload, headers={}, &block) Request.execute(:method => :post, :url => url, :payload => payload, :headers => headers, :timeout=>@timeout, :open_timeout=>@open_timeout, &block) end |