Class: Aws::Rest::Request::Body Private
- Inherits:
-
Object
- Object
- Aws::Rest::Request::Body
- Includes:
- Seahorse::Model::Shapes
- Defined in:
- lib/aws-sdk-core/rest/request/body.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 Method Summary collapse
- #apply(http_req, params) ⇒ Object private
-
#initialize(serializer_class, rules) ⇒ Body
constructor
private
A new instance of Body.
Constructor Details
#initialize(serializer_class, rules) ⇒ Body
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 Body.
12 13 14 15 |
# File 'lib/aws-sdk-core/rest/request/body.rb', line 12 def initialize(serializer_class, rules) @serializer_class = serializer_class @rules = rules end |
Instance Method Details
#apply(http_req, params) ⇒ Object
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.
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/aws-sdk-core/rest/request/body.rb', line 19 def apply(http_req, params) body = build_body(params) # for rest-json, ensure we send at least an empty object # don't send an empty object for streaming? case. if body.nil? && json_builder? && modeled_body? && !streaming? body = '{}' end http_req.body = body end |