HTTP methods (GET, POST, PUT, DELETE)
Në shqip: Metodat HTTP
ShpjegimiSQ
Metodat HTTP tregojnë çfarë do të bësh me një kërkesë: GET merr të dhëna, POST dërgon diçka të re, PUT/PATCH ndryshon diçka ekzistuese, DELETE fshin. Janë „foljet“ e komunikimit mes klientit dhe serverit.
EnglishEN
HTTP methods say what you want to do with a request: GET fetches data, POST sends something new, PUT/PATCH changes something existing, DELETE removes. They're the “verbs” of client–server communication.
Si ta mendosh
Si te biblioteka: „më jep librin“ (GET), „po dhuroj një libër“ (POST), „po e rregulloj kopertinën“ (PUT), „hiqeni nga katalogu“ (DELETE).
Lexoje në anglisht
Like at the library: “give me the book” (GET), “I'm donating a book” (POST), “I'm fixing the cover” (PUT), “take it out of the catalogue” (DELETE).
Shembull kodijavascript
await fetch("/api/studentet"); // GET
await fetch("/api/studentet", { method: "POST", body: JSON.stringify({ emri: "Arta" }) });
await fetch("/api/studentet/42", { method: "DELETE" });