我正在尝试将我的网络应用程序连接到PayU,我的代码是
require 'net/http'
require 'json'
uri = URI('https://test.payu.in/merchant/postservice')
req = Net::HTTP::Post.new(uri, initheader = {'Content-Type' =>'application/json'})
req.body = {key: "some key", command: "save_user_card", hash: "some code", var1: "some code",
var2: "dummy",
var3: "CC",
var4: "AMEX",
var5: "some name",
var6: "card number",
var7: "05",
var8: "2017"}.to_json
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(req)
end
,我得到的错误信息是
net/http/response.rb:41:in `read_status_line': wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">" (Net::HTTPBadResponse)
请提供一些解决此问题的提示。
答案 0 :(得分:1)