TROUBLE WITH FETCH API AND DON'T KNOW IS IT ENOUGH [Javascript]

i want to move on, i mean learn frameworks but currently I learned fetch api JS and don't know If i should study headers, cors and second parameter of fetch I know basically what headers do but not all of things which I can put on second parameter fetch, I can't get answer
8 Replies
$tqq59_
$tqq59_OP13mo ago
anyway, I looked on mdn and I can't find any explanations of how it works, only a brief description of how it works, which is not enough
glutonium
glutonium13mo ago
it's just http request when u add a 2nd param i api req is also i believe an https req but like you'd need the 2nd param when say u want to do post req I just did some practice with fetch , and req api calls but never practiced doing all the request methods . But i did understand the concept, like what's a status code, what's the header, what's the body etc as I felt like running in a loop i just started react after that I mean if u DO want to practice then migjt as well make a very simple api if r focusing on FE then just ig watch some tutorial on how to make api, like web dev simplified has a video on it which is nice u can follow those steps, make the thing and just focus on the http requests, like try playing around with it
$tqq59_
$tqq59_OP13mo ago
So I just need to know how cors works, headers, status code, method, etc. and that's it? Because if that's right, I'm done and I can move on, I know how to download, call in the console, convert to .json, etc.
Jochem
Jochem13mo ago
there's no "that's it". You keep learning you can probably use the fetch api now, so use it to build something also, this is pretty much the same thing you asked in #general right? For future reference, please don't doublepost
$tqq59_
$tqq59_OP13mo ago
okay, so do you think it's a good idea to do some exercises like build a wether app or someting like that? okay, i apologise
Jochem
Jochem13mo ago
yes, 100%. Building stuff is 100x more important than reading articles and watching videos make projects without following along with a tutorial or instructions, then google or ask for help (with a new post in #front-end) when you get stuck
$tqq59_
$tqq59_OP13mo ago
okay, thanks you all for help
glutonium
glutonium13mo ago
i mean just as jochem said it's not like, that's it there's more methods then just GET, POST, DELETE u can say u r gd to move on but you'll almost always find something new that u never saw before nonetheless, if u have the core concept done then yaa u can move onto framework I've moved onto react like 2 months ago. I chose it as my first even tho i wanted to learn svelte cause, well it's used everywhere and has large ecosystem. Plus i think going through the pain of react would make t learning other frameworks a lil easier xD
Want results from more Discord servers?
Add your server