Sha256: 6f5957b1db5606a7460b29f6da192dfe3099c88408cecd4d35b198bef8abc4a4
Contents?: true
Size: 823 Bytes
Versions: 5
Compression:
Stored size: 823 Bytes
Contents
# frozen_string_literal: true require 'httparty' module SoapyBing module Soap module Request class Base include Helpers::ClassName DEFAULT_HTTP_HEADERS = { 'Content-Type' => 'text/xml;charset=UTF-8' }.freeze attr_reader :context def initialize(context:) @context = context end def post(url, body: default_body, headers: default_headers) HTTParty.post(url, body: body, headers: headers) end def default_body TemplateRenderer.new(context).render(action_name.underscore) end def default_headers DEFAULT_HTTP_HEADERS.merge('SOAPAction' => action_name) end def action_name class_name.sub(/Request$/, '') end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems