开发者

How to control encoding when POSTing through Net::HTTP?

开发者 https://www.devze.com 2022-12-13 06:44 出处:网络
I\'m trying to create an API wrapper for Issuu using ruby and am running into errors when attempting to POST the data.When trying a simple GET through the browser with all the params in the querystrin

I'm trying to create an API wrapper for Issuu using ruby and am running into errors when attempting to POST the data. When trying a simple GET through the browser with all the params in the querystring, I am able to retrieve the expected results; however, when I try to perform the same operation using a POST in code (which the API claims to support), I consistently get an error stating that my api key is in an Invalid Format (which their documentation claims is likely an encoding issue).

Anyway, if I want to make 开发者_Go百科POST my values to a specific URL, how would I go about ensuring that everything is encoded in UTF-8? Is this part of the request header? Or do I need to do something specific to my strings first before POSTing the request?


Consider using both the enctype and accept-charset attributes in your form definition. More information is available here: http://www.w3.org/TR/html401/interact/forms.html#h-17.3

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号