我正在尝试发布内容类型的请求:application / x-www-form-urlencoded。但当我查看Charles(或Fiddler)的请求时,它会显示application / json。
HTTP.post(url,
{
:headers => {"Content-Type" => "application/x-www-form-urlencoded"}
}) do |response|
puts response
puts response.body.to_str
end
答案 0 :(得分:0)
BW::HTTP.post("http://foo.bar.com/", {payload: data, headers: {"Content-Type": "application/x-www-form-urlencoded"} }) do |response|