Merhaba fetch API ile bir get isteği attım. Bu kodda async ve awaitin amacı bir işlem başarısız olunca diğerinin çalışmasını bitirmek mi?
Bir de bunu nasıl get değil de post işlemi olarak yaparım?
JavaScript:
const url = "https://jsonplaceholder.typicode.com/posts";
const getUser = async url => {
const response = await fetch(url);
const data = await response.json();
console.log(data)
}
getUser(url);
Bir de bunu nasıl get değil de post işlemi olarak yaparım?