Class: ApiPost
- Defined in:
- lib/tester/definition/methods/api_post.rb
Instance Attribute Summary collapse
-
#syntax_error_response ⇒ Object
Returns the value of attribute syntax_error_response.
Attributes inherited from ApiMethod
#expected_response, #request, #url
Instance Method Summary collapse
- #call(body_params = {}, request_params = {}) ⇒ Object
- #post(json_payload, headers) ⇒ Object
- #verb ⇒ Object
Methods inherited from ApiMethod
Constructor Details
This class inherits a constructor from ApiMethod
Instance Attribute Details
#syntax_error_response ⇒ Object
Returns the value of attribute syntax_error_response.
11 12 13 |
# File 'lib/tester/definition/methods/api_post.rb', line 11 def syntax_error_response @syntax_error_response end |
Instance Method Details
#call(body_params = {}, request_params = {}) ⇒ Object
19 20 21 |
# File 'lib/tester/definition/methods/api_post.rb', line 19 def call body_params={}, request_params={} post body_params.to_json, request_params end |
#post(json_payload, headers) ⇒ Object
13 14 15 16 17 |
# File 'lib/tester/definition/methods/api_post.rb', line 13 def post json_payload, headers RestClient.post(self.url, json_payload, headers) { |real_response, request, result| real_response } end |
#verb ⇒ Object
23 24 25 |
# File 'lib/tester/definition/methods/api_post.rb', line 23 def verb SupportedVerbs::POST end |