Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

api giving 401 from wget/curl, but working fine from Chrome/Firefox browsers

Dale Jenkins Nov 11, 2017 12:18AM UTC

Making following call to API:
http://api.openweathermap.org/data/2.5/weather?lat=-34.xxxx&lon=150.xxxx&lang=EN&mode=json&units=metric&APPID=xxxxxxx

Using wget I receive a 401 Auth Failed message. From Chrome/Firefox the expeceted data is returned.

Is there a UserAgent string that needs to be set, or are there other factors that could be impacting on this?

Up 0 rated Down
Maxim Gushcho Nov 13, 2017 11:12AM UTC OpenWeatherMap Agent

Hello,

Since the syntax is correct ans it works in the browser, please check the settings that is used for making a request.

The request method should be “GET”.

Thanks.

Up 0 rated Down
Roman Nov 19, 2017 10:39AM UTC
Good day,

I am having same problem.
The request method used is "NODE-FETCH"

Can it be a problem?

Br, Roman.
Up 0 rated Down
Maxim Gushcho Nov 20, 2017 04:54PM UTC OpenWeatherMap Agent

Hello,

The request Method should be “GET”.

Thanks.

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
9eda11838f597e7a95b6a1c991dcae0a@openweathermap.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete