Question

J'ai une URL comme http://example.com/tag/София/new.json et je veux faire une demande GET avec HTTParty. Quand je fais:

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

Je reçois:

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

Toutes les idées comment gérer cette situation?

Était-ce utile?

La solution

Le norme dit « encode l'URL en UTF-8, représentent alors plusieurs séquences -Byte comme octets échappé cent- « . Dans votre cas,

http://example.com/tag/%D0%A1%D0%BE%D1%84%D0%B8%D1%8F/new.json
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top