module SilverPop::Request

Public Instance Methods

post(body) click to toggle source
# File lib/silverpop/request.rb, line 3
def post(body)
  request(:post, body)
end

Private Instance Methods

request(method, body) click to toggle source

POST the XML to the SilverPop end point.

@param body [String] The formatted XML of the API call make sure to call builder.to_xml. @return [XML] XML Body from the API call

# File lib/silverpop/request.rb, line 13
def request(method, body)
  response = connection.send(method) do |request|
    request.url "/XMLAPI"
    request.headers['Content-type'] = "text/xml"
    request.body = body
  end
  response.body
end