如何解决net http内部服务器错误

时间:2014-01-16 20:11:02

标签: ruby net-http

我将xml for post_xml中的xml数据传递给Web服务,该服务读取此数据但是收到错误#我的传递方法如下所示。我错过了什么,或者我该怎么做。谢谢

require 'net/http'
require 'open-uri'

pegPayStatusCode = ""
conn = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
   if uri.scheme == 'https'
    require 'net/https'
    conn.use_ssl = true
    conn.verify_mode = OpenSSL::SSL::VERIFY_NONE   # needed for windows environment
  end
#request.body=post_xml

request.set_form_data({"q" => "#{post_xml}", "per_page" => "50"})
response = conn.request(request)

pegPayStatusCode = response

0 个答案:

没有答案