Pregunta

Tengo una URL como http://example.com/tag/София/new.json y quiero hacer una petición GET con HTTParty. Cuando hago:

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

Puedo obtener:

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

¿Alguna idea de cómo manejar esto?

¿Fue útil?

Solución

El norma dice "codificar la URL como UTF-8, a continuación, representan múltiples secuencias -byte como octetos por ciento-escapado ". En su caso,

http://example.com/tag/%D0%A1%D0%BE%D1%84%D0%B8%D1%8F/new.json
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top