Method: OData::Service#execute

Defined in:
lib/odata/service.rb

#execute(url_chunk, additional_options = {}) ⇒ Typhoeus::Response

Execute a request against the service

Parameters:

  • url_chunk (to_s)

    string to append to service url

  • additional_options (Hash) (defaults to: {})

    options to pass to Typhoeus

Returns:

  • (Typhoeus::Response)


91
92
93
94
95
96
97
98
99
100
# File 'lib/odata/service.rb', line 91

def execute(url_chunk, additional_options = {})
  request = ::Typhoeus::Request.new(
      URI.escape("#{service_url}/#{url_chunk}"),
      options[:typhoeus].merge({
        method: :get
      }).merge(additional_options)
  )
  request.run
  request.response
end