diff --git a/2-copy-of-code/lesson-18/lesson18.html b/2-copy-of-code/lesson-18/lesson18.html index 94c1e3b..cd857df 100644 --- a/2-copy-of-code/lesson-18/lesson18.html +++ b/2-copy-of-code/lesson-18/lesson18.html @@ -22,12 +22,30 @@ }); */ + /* async function getGreeting() { const response = await fetch('https://supersimplebackend.dev/greeting'); const text = await response.text(); console.log(text); } getGreeting(); + */ + + async function postGreeting() { + const response = await fetch('https://supersimplebackend.dev/greeting', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + name: 'SuperSimpleDev' + }) + }); + + const text = await response.text(); + console.log(text); + } + postGreeting(); \ No newline at end of file