Question: Can you complete this fetch js code problem: instructions: Code Instructions Create a function called addPerson in the fetch-post.js file. Inside the function, make a
Can you complete this fetch js code problem:
instructions:
Code Instructions
Create a function called addPerson in the fetch-post.js file.
Inside the function, make a POST request to http://example.com/api/people with the following JSON body:
{ "firstName": "Maul", "lastName": "Kimmerman" } If you format your request properly, you can expect the body of the response to be:
{ "people": [ { "id": 1, "lastName": "Zimmerman", "firstName": "Paul" }, { "id": 2, "lastName": "Yimmerman", "firstName": "Raul" }, { "id": 3, "lastName": "Limmerman", "firstName": "Caul" }, { "id": 9, "lastName": "Kimmerman", "firstName": "Maul" }, ] } Return the value of the people key from the addPerson function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
