开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜