使用x-www-form-urlencoded的POST请求失败

时间:2013-08-11 19:22:01

标签: ruby typhoeus

我需要将带有x-www-form-urlencoded参数的POST请求发送到URL。我为此目的使用Typhoeus gem。

@fetch = Typhoeus::Request.post("http://www.diyanet.gov.tr/turkish/namazvakti/vakithes_namazsonuc.asp", :params => {"ulk"=>"TURKIYE", "sehirler"=>"ADANA", "R1"=>"AYLIK"}, :headers=>{"Content-type"=>"application/x-www-form-urlencoded"})

但我没有达到我的预期......

这是下面的Postman(镀铬扩展)截图。正如您所看到的,我将所有内容设置为相同并且在Postman中正常运行。

enter image description here

你知道出了什么问题吗?

也欢迎不同的解决方案/宝石......

1 个答案:

答案 0 :(得分:0)

好吧,我已经开了issue了。

我只需要params改变body。我认为这是x-www-form-urlencoded参数的结构......

哦,我的怜悯3小时。