Class: ApiPost

Inherits:
ApiMethod show all
Defined in:
lib/tester/definition/methods/api_post.rb

Instance Attribute Summary collapse

Attributes inherited from ApiMethod

#expected_response, #request, #url

Instance Method Summary collapse

Methods inherited from ApiMethod

#initialize

Constructor Details

This class inherits a constructor from ApiMethod

Instance Attribute Details

#syntax_error_responseObject

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

#verbObject



23
24
25
# File 'lib/tester/definition/methods/api_post.rb', line 23

def verb
  SupportedVerbs::POST
end