Class: Faraday::RequestOptions
- Defined in:
- lib/faraday/options/request_options.rb
Overview
RequestOptions contains the configurable properties for a Faraday request.
Instance Attribute Summary collapse
-
#bind ⇒ Hash
The local host and port to bind the connection to.
-
#boundary ⇒ String
The boundary used for multipart request bodies.
-
#context ⇒ Hash
Free-form storage carried alongside the request.
-
#oauth ⇒ Hash
OAuth options used by the OAuth middleware.
-
#on_data ⇒ Proc
Callback invoked with each chunk when streaming the response.
-
#open_timeout ⇒ Integer
Time limit for just the connection phase (in seconds).
-
#params_encoder ⇒ Object
The params encoder used to serialize the request params.
-
#proxy ⇒ ProxyOptions
Proxy options for this request.
-
#read_timeout ⇒ Integer
Time limit for the first response byte received from the server (in seconds).
-
#timeout ⇒ Integer
Time limit for the entire request (in seconds).
-
#write_timeout ⇒ Integer
Time limit for the client to send the request to the server (in seconds).
Method Summary
Methods inherited from Options
#[], attribute_options, #clear, #deep_dup, #delete, #each, #each_key, #each_value, #empty?, #fetch, fetch_error_class, from, inherited, #inspect, #key?, #keys, memoized, memoized_attributes, #merge, #merge!, options, options_for, #symbolized_key_set, #to_hash, #update, #value?, #values_at
Instance Attribute Details
#bind ⇒ Hash
Returns the local host and port to bind the connection to.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#boundary ⇒ String
Returns the boundary used for multipart request bodies.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#context ⇒ Hash
Returns free-form storage carried alongside the request.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#oauth ⇒ Hash
Returns OAuth options used by the OAuth middleware.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#on_data ⇒ Proc
Returns callback invoked with each chunk when streaming the response.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#open_timeout ⇒ Integer
Returns time limit for just the connection phase (in seconds).
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#params_encoder ⇒ Object
Returns the params encoder used to serialize the request params.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#proxy ⇒ ProxyOptions
Returns proxy options for this request.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#read_timeout ⇒ Integer
Returns time limit for the first response byte received from the server (in seconds).
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#timeout ⇒ Integer
Returns time limit for the entire request (in seconds).
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |
#write_timeout ⇒ Integer
Returns time limit for the client to send the request to the server (in seconds).
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/faraday/options/request_options.rb', line 42 RequestOptions = Options.new(:params_encoder, :proxy, :bind, :timeout, :open_timeout, :read_timeout, :write_timeout, :boundary, :oauth, :context, :on_data) do def []=(key, value) if key && key.to_sym == :proxy super(key, value ? ProxyOptions.from(value) : nil) else super end end def stream_response? on_data.is_a?(Proc) end end |