我遇到了一个问题,当我运行构造的curl命令时服务器响应带有204(意图),但是当我构造具有相同配置的法拉第对象时,它失败并出现500错误 - IIS < / p>
缺少必需参数
curl命令:
curl -v -i -H "Content-Type: application/xml" -H "HEADER1: VALUE" -H "HEADERSERVICENAME: VALUE" -X POST -d '<empty string>' HOST_GOES_HERE
我的法拉第代码:
conn = Faraday.new <HOST_GOES_HERE>, :ssl => {:version => :SSLv3}
response = conn.post do |req|
req.headers['Content-Type'] = 'application/xml'
req.headers['HEADER1'] = "VALUE"
req.headers['HEADERSERVICENAME'] = "VALUE"
req.body = ''
end
我唯一能想到的是curl是否发送了一些未在curl命令中设置的额外标题。
答案 0 :(得分:1)