Well, I've opened an issue about this.
All I had to was changing params
with body
. I think It's about structure of x-www-form-urlencoded
parameters...
Oh my pity 3 hours.
题
I need to send a POST request with x-www-form-urlencoded parameters to a URL. I'm using Typhoeus
gem for this purpose.
@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"})
But I don't get what I expected...
This is Postman (chrome extension) screenshot below. As you can see, I'm setting everything the same and it runs properly at Postman.
Do you have any idea what's going wrong?
Different solutions/gems are welcomed too...
解决方案
Well, I've opened an issue about this.
All I had to was changing params
with body
. I think It's about structure of x-www-form-urlencoded
parameters...
Oh my pity 3 hours.