Class: Candid::Internal::Multipart::Request Private
- Inherits:
-
Http::BaseRequest
- Object
- Http::BaseRequest
- Candid::Internal::Multipart::Request
- Defined in:
- lib/candid/internal/multipart/multipart_request.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #body ⇒ Object readonly private
Attributes inherited from Http::BaseRequest
#base_url, #headers, #method, #path, #query, #request_options
Instance Method Summary collapse
-
#encode_body ⇒ String?
private
The encoded HTTP request body.
-
#encode_headers ⇒ Hash
private
The encoded HTTP request headers.
-
#initialize(base_url:, path:, method:, headers: {}, query: {}, body: nil, request_options: {}) ⇒ Request
constructor
private
A new instance of Request.
Constructor Details
#initialize(base_url:, path:, method:, headers: {}, query: {}, body: nil, request_options: {}) ⇒ Request
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Request.
17 18 19 20 21 |
# File 'lib/candid/internal/multipart/multipart_request.rb', line 17 def initialize(base_url:, path:, method:, headers: {}, query: {}, body: nil, request_options: {}) super(base_url:, path:, method:, headers:, query:, request_options:) @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/candid/internal/multipart/multipart_request.rb', line 8 def body @body end |
Instance Method Details
#encode_body ⇒ String?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The encoded HTTP request body.
31 32 33 |
# File 'lib/candid/internal/multipart/multipart_request.rb', line 31 def encode_body @body&.encode end |
#encode_headers ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The encoded HTTP request headers.
24 25 26 27 28 |
# File 'lib/candid/internal/multipart/multipart_request.rb', line 24 def encode_headers { "Content-Type" => @body.content_type }.merge(@headers) end |