islamic-network / api.aladhan.com

The AlAdhan API
GNU General Public License v3.0
118 stars 30 forks source link

state or region parameter to timingsByCity is not recognized or validated correctly #52

Closed AlGantori closed 2 years ago

AlGantori commented 2 years ago

Is "region" a recognized parameter in the URL? it's not in the docs at.
https://aladhan.com/prayer-times-api#GetTimingsByCity

image

The API does not complain about unknown parameters like foo=CA however documented parameter state=CA is not accepted either but state=California is accepted.

http://api.aladhan.com/v1/timingsByCity?city=los%20angeles&state=CA&country=USA&method=2 also NOT accepted the following

http://api.aladhan.com/v1/timingsByCity?city=Corvallis&state=Oregon&country=USA&method=2

http://api.aladhan.com/v1/timingsByCity?city=Corvallis&state=OR&country=USA&method=2

image

Thank you.

meezaan commented 2 years ago

@AlGantori for me http://api.aladhan.com/v1/timingsByCity?city=los%20angeles&state=CA&country=USA&method=2 returns a valid response. As does http://api.aladhan.com/v1/timingsByCity?city=Corvallis&state=OR&country=USA&method=2.

Can you please ping api.aladhan.com and let me know which IP address you see. I'll check if it at some point Google returned an error for geocoding and the errored value is cached in the cluster you are accessing.

AlGantori commented 2 years ago

Following either links will open new browser tabs every time I refresh, and always returns the same response code: 400, status "Bad Request"...

Here the result of the ping: image

meezaan commented 2 years ago

Thank you. I will have a look today insha'Allah.

meezaan commented 2 years ago

I've flushed the cache, please try now.

AlGantori commented 2 years ago

It's working!!! Thank you so much! May Allah SWT reward you immensely. FYI,

  1. On the Firefox it took many attempts to clear the cache on my side, like control-shift-del, and a bunch of Ctrl-F5, only then it started returning data. Perhaps you have a better procedure?

image

  1. On the Chrome it worked immediately.