Instructions:
- An HTML form is given in the index.html. In the
index.jsfile, create a post request on form submission.
Requirements:
-
Use fetch to post data.
-
Use
async awaitsyntax. -
When resolving your promise, print the raw JSON to the console.
-
Alert the user once they have submitted the form.
-
You can use JSONPlaceholder to make a POST request.
⌛ Give it a minute. As long as you see the orange dot
on top, CodeBuddy is still processing. Refresh this page to see it's current status.
This is what CodeBuddy found when running your code. It is to show you what you have achieved and to give you hints on how to complete the exercise.
| Status | Check |
|---|---|
Should make POST request using fetch on submit |
| Status | Check |
|---|---|
async/await syntax should be used |
| Status | Check |
|---|---|
| Should print response JSON to the console |
| Status | Check |
|---|---|
| Alert should be displayed after fetching the data |
