3 ms·
They mean you can’t interact with a raw API from the browser. Unless you are just doing vanilla gets. You might use a REST client instead or what some services
by quickthrower2 3y ago
They mean you can’t interact with a raw API from the browser. Unless you are just doing vanilla gets.
You might use a REST client instead or what some services do is offer a playground coded in JS to play with the end point but such a playground needs to deal with CORS.
- lolinder 3y agoBut this also isn't true—fetch can run all the HTTP request verbs. What they seem to mean is that you can't access most of them via the GUI directly, which is true, but their "solution" is to make queries and commands both use POST, which means they've now thrown away the ability to even access read-only endpoints via the GUI.
- Turing_Machine 3y ago> But this also isn't true—fetch can run all the HTTP request verbs. Yep, or even custom ones that you've defined for specialized purposes (obviously you have to make sure your server also understands them).
- quickthrower2 3y agoOk I accept that - I guess you could F12, drop into the console and then fetch. Which is broadly similar to using curl. I also don't like the idea of making queries and commands use POST. It kind of sucks (unless you are doing it for a website that is trying to avoid using JS for some reason).