In this tutorial, you learn the operations to call to delete a user from the service. Expect this tutorial to take about 15 minutes to complete.
Make sure you’ve completed the Before you start a tutorial topic on the development system you’ll use for the tutorial.
Deleting a user from the service requires that you use the DELETE
method to remove the user
resource from the service.
Make sure your local service is running, or start it by using this command, if it’s not:
cd <your-github-workspace>/to-do-service/api
json-server -w to-do-db-source.json
In the Postman app, create a new request with these values:
/users/{userId}
{userId}
with the actual ID of the user you want to deleteContent-Type: application/json
userId
is successfully deleted.After doing this tutorial in Postman, you might like to repeat it in your favorite programming language. To do this, adapt the values from the tutorial to the properties and arguments that the language uses to make REST API calls.