我正在使用Ruby进行HTTP请求:
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req.body = payload
req['customeheader'] = 'xxxxxxxxx'
http.set_debug_output $stdout
我已开启调试模式,当请求被提交时,我可以看到头部信息被提交为:
Customheader: xxxxxxxxx
有没有办法阻止这种情况发生?我正在向第三方服务器发布内容,但是因为头部名称不正确而出现错误 - 它期望的是
customheader:
。请问该怎么做?