如何使用Bubblewrap HTTP设置Content-type?

时间:2013-02-05 17:03:09

标签: ios ruby http-headers rubymotion

我正在尝试发布内容类型的请求: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

1 个答案:

答案 0 :(得分:0)

BW::HTTP.post("http://foo.bar.com/", {payload: data, headers: {"Content-Type": "application/x-www-form-urlencoded"} }) do |response|