Support Center

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

Suddenly started getting 404 error and CORS error

Andrew F Jan 01, 2019 07:25PM GMT

Hello,

I'm a boot camp student, working on a class project. Very new to these things so I appreciate any help. To clarify beforehand, I've replaced my API key with MYKEY in all of the following.

I had been getting blocked by CORS when using $.getJSON("api.openweathermap.org/ImageBox/2.5/weather?q=philadelphia&appid=MYKEY

Then this morning I had a revelation and put http:// prior to the api.openweathermap... and suddenly my API calls started working. After about an hour of tweaking the rest of my JS, I once again started getting error messages.

GET http://api.openweathermap.org/ImageBox/2.5/weather?q=philadelphia&appid=MYKEY 404 (Not Found)

and

Access to XMLHttpRequest at 'http://api.openweathermap.org/ImageBox/2.5/weather?q=philadelphia&appid=MYKEY' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I'm not sure what happened. I moved some of the javascript files around the directory, but I don't see how that could have triggered these. I understand that the 404 errors could just be the API being overloaded, but with the CORS error also present I believe there may be another problem also.

Help is greatly appreciated. Thank you in advance.

Up 0 rated Down
Pavel Zuykov Jan 03, 2019 07:31PM GMT OpenWeatherMap Agent

Hello,

Thank you for request.

What is /ImageBox/ in your API call? The right call is http://api.openweathermap.org/data/2.5/weather?q=philadelphia&appid=MYKEY

If you are using CORS, you should specify headers.

404 error is not about overloading, but “Not found” (Because you are using wrong URL)

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