To follow redirects, set
https://metacpan.org/pod/Mojo::UserAgent#max_redirects

On Sat, Jun 27, 2015 at 6:15 PM, Stefan Adams <[email protected]> wrote:

>
> On Sat, Jun 27, 2015 at 5:10 AM, Pavel Serikov <[email protected]>
> wrote:
>
>> Yeah, it's working :)
>>
>> But *warn Dumper
>> ($ua->get('http://geocode-maps.yandex.ru/1.x/?geocode=Москва&format=json')-
>> <http://geocode-maps.yandex.ru/1.x/?geocode=%D0%9C%D0%BE%D1%81%D0%BA%D0%B2%D0%B0&format=json')->>res->json)
>> *doesn't. $VAR1 = undef
>>
>> So problem is in res->json method?
>>
>
> Notice Bernhard's URL had *https*.  The http URL you supplied returns a
> 301 redirect to *https*, which of course the 301 response has no JSON in
> the response.
>
> $ perl -MData::Dumper -MMojo::UserAgent -E 'warn Dumper
> (Mojo::UserAgent->new->get(q(
> https://geocode-maps.yandex.ru/1.x/?geocode=Moscow&format=json))-
> >res->json)'
> $VAR1 = {
>           'response' => {
> ...
>                       }
>         };
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to