Sha256: 26bb6e936c625ce884c2d5fd56b7e45e6eaa3c2728bcd827a4b043b81fd1073b

Contents?: true

Size: 542 Bytes

Versions: 4

Compression:

Stored size: 542 Bytes

Contents

module GoAcoustic
  module Request
    def post(body)
      request(:post, body)
    end

    private

    # POST the XML to the GoAcoustic 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
    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
goacoustic-0.1.4 lib/goacoustic/request.rb
goacoustic-0.1.3 lib/goacoustic/request.rb
goacoustic-0.1.2 lib/goacoustic/request.rb
goacoustic-0.1.1 lib/goacoustic/request.rb