403 Forbidden in Yandex Weather API

1.4k Views Asked by At

I need to create some app. This app shows weather forecast. Google weather API gone. But Yandex have this API.My code right, but with this api i have some problem. In the example write:https://api.weather.yandex.ru/v1/forecast?geoid=213&l10n=true. But this example return 403.https://api.weather.yandex.ru/v1/forecast?geoid=2&lang=ru_RU also return 403.But once it return forecast then it returns 403.

1

There are 1 best solutions below

6
On BEST ANSWER

If You use HttpURLConnection may be some parameters of header missing (like content-type or encoding). And probably HttpURLConnection should be configured like setRequestMethod("GET"); or something like that: HTTP Authentication, Proxy, Cookies and so on (take a look at Official Documentation).