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.
121 122 123 124 125 126 127 128 |
# File 'lib/openai/http_client.rb', line 121 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)
111 112 113 |
# File 'lib/openai/http_client.rb', line 111 def body @body end |
#headers ⇒ Hash{String=>String} (readonly)
108 109 110 |
# File 'lib/openai/http_client.rb', line 108 def headers @headers end |
#method ⇒ Symbol (readonly)
102 103 104 |
# File 'lib/openai/http_client.rb', line 102 def method @method end |
#timeout ⇒ Float? (readonly)
114 115 116 |
# File 'lib/openai/http_client.rb', line 114 def timeout @timeout end |
#url ⇒ URI::Generic (readonly)
105 106 107 |
# File 'lib/openai/http_client.rb', line 105 def url @url end |