Closed GeoffreyFrogeye closed 4 years ago
I can't reproduce your issue.
I tried leafeon
as well as other pokemons (with and without trailing slashes) and I'm not getting a 404 error.
What python version are you using? And which pokepy version? Are you running pokepy within a virtual environment or alongside other projects?
I just tried again and I can't reproduce this again anymore, even though I did not change anything.
Even curl https://pokeapi.co:443/api/v2/pokemon/leafeon
will now output the correct result where it would 404 earlier. Also I noticed that the API is way faster than before (4-5 requests per seconds rather than 1 request per second earlier). Can it be a caching thing? I noticed the API runs on CloudFlare.
It's not really relevant anymore but I tried different combinations with pokepi 8233cbf327650d96ea2940566bc92dc45903e959 and 0.6.0, python 3.7 and 3.8, with pokepi installed in my user directory along other things and in a virtualenv, and from two different IP addresses (although not far from each other). All used to fail before I started writing the issue, now all works.
So if we assume the API won't do that again there's no need to do anything. But this was a bit weird...
Definitely weird. Try opening an issue on the pokeapi repo.
I'll close this as it seems to be solved.
An example is better than a thousands words:
client.get_pokemon_species('leafeon')
fails.Just for reference:
(I couldn't find other examples where it was failing)
At first glance the problem seems that the API have an inconsistent behavior regarding trailing slashes. When can reproduce the same behavior with another browser that does such as
curl
that does not automatically add trailing slashes. But this issue seems to imply that the client must add the trailing slashes itself, which this does not.