大家好。
我的应用程序与远程服务器一起工作。服务器使用证书的 https 授权。我有以下代码来授权和发送请求:
uri = URI.parse("https://db1-test.content.ertelecom.ru/")
http = Net::HTTP.new(uri.host, '443')
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.ca_file = File.join(File.dirname("public/certificate.pem"),
"certificate.pem")
http.start do |http|
req =
Net::HTTP::Get.new("/cgi-bin/expr/export.get_pay_systems?partner_id=1003")
responce = http.request(req)
resp = responce.body
end
此代码运行良好,我从服务器获取数据。但是当我尝试发出 POST 请求时:
http.start do |http|
req =
Net::HTTP::Post.new("/cgi-bin/expr/payment_transactions.verify_order",
params)
responce = http.request(req)
resp = responce.body
end
我从服务器收到一个错误:
Your browser sent a request that this server could not understand.
Request header field is missing ':' separator.
那是什么?我试图找到解决方案,但无济于事。互联网捕捉到它可能是防病毒的消息,但我在 Linux 上。我会很高兴有任何想法!