method
send_post

v1_8_7_72 -
Show latest stable
-
0 notes -
Class: SOAP::HTTPStreamHandler
- 1_8_6_287 (0)
- 1_8_7_72 (0)
- 1_8_7_330 (0)
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
send_post(endpoint_url, conn_data, charset)
private
Hide source
# File lib/soap/streamHandler.rb, line 151 def send_post(endpoint_url, conn_data, charset) conn_data.send_contenttype ||= StreamHandler.create_media_type(charset) if @wiredump_file_base filename = @wiredump_file_base + '_request.xml' f = File.open(filename, "w") f << conn_data.send_string f.close end extra = {} extra['Content-Type'] = conn_data.send_contenttype extra['SOAPAction'] = "\"#{ conn_data.soapaction }\"" extra['Accept-Encoding'] = 'gzip' if send_accept_encoding_gzip? send_string = conn_data.send_string @wiredump_dev << "Wire dump:\n\n" if @wiredump_dev begin retry_count = 0 while true res = @client.post(endpoint_url, send_string, extra) if RETRYABLE and HTTP::Status.redirect?(res.status) retry_count += 1 if retry_count >= MAX_RETRY_COUNT raise HTTPStreamError.new("redirect count exceeded") end endpoint_url = res.header["location"][0] puts "redirected to #{endpoint_url}" if $DEBUG else break end end rescue @client.reset(endpoint_url) raise end @wiredump_dev << "\n\n" if @wiredump_dev receive_string = res.content if @wiredump_file_base filename = @wiredump_file_base + '_response.xml' f = File.open(filename, "w") f << receive_string f.close end case res.status when 405 raise PostUnavailableError.new("#{ res.status }: #{ res.reason }") when 200, 500 # Nothing to do. else raise HTTPStreamError.new("#{ res.status }: #{ res.reason }") end if res.respond_to?(:header) and !res.header['content-encoding'].empty? and res.header['content-encoding'][0].downcase == 'gzip' receive_string = decode_gzip(receive_string) end conn_data.receive_string = receive_string conn_data.receive_contenttype = res.contenttype conn_data end