Class: OpenAI::HTTPClient::Request
- Inherits:
-
Object
- Object
- OpenAI::HTTPClient::Request
- Defined in:
- lib/openai/http_client.rb,
sig/openai/http_client.rbs
Overview
An HTTP request prepared by the SDK.
Instance Attribute Summary collapse
- #body ⇒ Object? readonly
- #headers ⇒ Hash{String=>String} readonly
- #method ⇒ Symbol readonly
- #timeout ⇒ Float readonly
- #url ⇒ URI::Generic readonly
Instance Method Summary collapse
-
#initialize(method:, url:, headers:, body:, timeout:) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(method:, url:, headers:, body:, timeout:) ⇒ Request
Returns a new instance of Request.
32 33 34 35 36 37 38 39 |
# File 'lib/openai/http_client.rb', line 32 def initialize(method:, url:, headers:, body:, timeout:) @method = method @url = url @headers = headers.dup.freeze @body = body @timeout = timeout freeze end |
Instance Attribute Details
#body ⇒ Object? (readonly)
22 23 24 |
# File 'lib/openai/http_client.rb', line 22 def body @body end |
#headers ⇒ Hash{String=>String} (readonly)
19 20 21 |
# File 'lib/openai/http_client.rb', line 19 def headers @headers end |
#method ⇒ Symbol (readonly)
13 14 15 |
# File 'lib/openai/http_client.rb', line 13 def method @method end |
#timeout ⇒ Float (readonly)
25 26 27 |
# File 'lib/openai/http_client.rb', line 25 def timeout @timeout end |
#url ⇒ URI::Generic (readonly)
16 17 18 |
# File 'lib/openai/http_client.rb', line 16 def url @url end |