lib/soaspec/exchange_handlers/rest_handler.rb in soaspec-0.0.63 vs lib/soaspec/exchange_handlers/rest_handler.rb in soaspec-0.0.64
- old
+ new
@@ -112,12 +112,13 @@
def rest_resource_options
{
}
end
+ # Perform ERB on each header value
+ # @return [Hash] Hash from 'rest_client_headers' passed through ERB
def parse_headers
- # rest_client_headers.map { |h| ERB.new(h).result(binding) }
Hash[rest_client_headers.map { |k, header| [k, ERB.new(header).result(binding)] }]
end
# Setup object to handle communicating with a particular SOAP WSDL
# @param [Hash] options Options defining SOAP request. WSDL, authentication
@@ -138,14 +139,15 @@
end
# Used in together with Exchange request that passes such override parameters
# @param [Hash] override_parameters Params to characterize REST request
# @param_value [params] Extra parameters (E.g. headers)
- # @param_value [suburl] URL appended to base_url of clss
+ # @param_value [suburl] URL appended to base_url of class
# @param_value [method] REST method (get, post, etc)
def make_request(override_parameters)
test_values = override_parameters
test_values[:params] ||= {}
+ test_values[:method] ||= :post
test_values[:suburl] = test_values[:suburl].to_s if test_values[:suburl]
test_values[:params][:params] = test_values[:q] if test_values[:q] # Use q for query parameters. Nested :params is ugly and long
@resource_used = test_values[:suburl] ? @resource[test_values[:suburl]] : @resource
\ No newline at end of file