Class: Faraday::RequestOptions

Inherits:
Options
  • Object
show all
Defined in:
lib/faraday/options/request_options.rb

Overview

RequestOptions contains the configurable properties for a Faraday request.

Instance Attribute Summary collapse

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

#bindHash

Returns the local host and port to bind the connection to.

Returns:

  • (Hash)

    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

#boundaryString

Returns the boundary used for multipart request bodies.

Returns:

  • (String)

    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

#contextHash

Returns free-form storage carried alongside the request.

Returns:

  • (Hash)

    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

#oauthHash

Returns OAuth options used by the OAuth middleware.

Returns:

  • (Hash)

    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_dataProc

Returns callback invoked with each chunk when streaming the response.

Returns:

  • (Proc)

    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_timeoutInteger

Returns time limit for just the connection phase (in seconds).

Returns:

  • (Integer)

    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_encoderObject

Returns the params encoder used to serialize the request params.

Returns:

  • (Object)

    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

#proxyProxyOptions

Returns proxy options for this request.

Returns:



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_timeoutInteger

Returns time limit for the first response byte received from the server (in seconds).

Returns:

  • (Integer)

    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

#timeoutInteger

Returns time limit for the entire request (in seconds).

Returns:

  • (Integer)

    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_timeoutInteger

Returns time limit for the client to send the request to the server (in seconds).

Returns:

  • (Integer)

    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