[英]How do I set Content-type using Bubblewrap HTTP?
I'm trying to post a request with content-type: application/x-www-form-urlencoded. 我正在尝试发布内容类型为:application / x-www-form-urlencoded的请求。 But when I view the request with Charles (or Fiddler) it says application/json. 但是当我与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
BW::HTTP.post("http://foo.bar.com/", {payload: data, headers: {"Content-Type": "application/x-www-form-urlencoded"} }) do |response|
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.