class Bambora::Rest::XMLClient

The base class for making XML requests.

Constants

CONTENT_TYPE
RESPONSE_FORMAT

Public Instance Methods

post(path:, body:) click to toggle source

Make a POST Request.

@param path [String] Indicating request path. @param body [Hash] Data to be sent in the body of the request. @param api_key [String] Indicating the API Key to be used with the request.

@return [Hash] Indicating success or failure of the operation.

Calls superclass method Bambora::Rest::Client#post
# File lib/bambora/rest/xml_client.rb, line 18
def post(path:, body:)
  parse_response_body(
    super(
      path: path,
      body: Bambora::Builders::XMLRequestBody.new(body: body).to_s,
      headers: build_headers,
    ),
  )
end

Private Instance Methods

build_headers() click to toggle source
# File lib/bambora/rest/xml_client.rb, line 30
def build_headers
  { 'Content-Type' => CONTENT_TYPE }
end