You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks, is it possible to get something like swapi.com/api/vehicles/random?
I'm making this app that gets a random thing by putting a random number in the url. (from 1 to the "count" of entries specified in the description of each endpoint) But sometimes I get a 404 errors.
For instance, there are 37 total vehicles, when I get a number in between, let's say 13, I get a 404 http://swapi.co/api/vehicles/13/
I would love to contribute but I only know Javascript :/
The text was updated successfully, but these errors were encountered:
@savovs IDs are not necessarily in order, they're just an identifier :)
I would suggest calling the endpoint to get a list of available resources, paginating through them, and storing the URL for each:
https://swapi.co/api/vehicles
Then your random function can be in your code.
Regarding your ability to contribute: you totally can! This project is intended to teach people, so don't feel that just because you've never written Python you can't help.
Hi folks, is it possible to get something like
swapi.com/api/vehicles/random
?I'm making this app that gets a random thing by putting a random number in the url. (from 1 to the "count" of entries specified in the description of each endpoint) But sometimes I get a 404 errors.
For instance, there are 37 total vehicles, when I get a number in between, let's say 13, I get a 404 http://swapi.co/api/vehicles/13/
I would love to contribute but I only know Javascript :/
The text was updated successfully, but these errors were encountered: