我有一个网址像 http://example.com/tag/София/new.json 我想要让一让请求与HTTParty.当我这样做:

HTTPArty.获得"http://example.com/tag/София/new.json

我得到:

URI::InvalidURIError at /
bad URI(is not URI?): link here

任何想法如何处理这个吗?

有帮助吗?

解决方案

标准 说"编码的网址作为UTF-8,然后表示多字节的序列%的逃八." 在你的情况,

http://example.com/tag/%D0%A1%D0%BE%D1%84%D0%B8%D1%8F/new.json
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top