Using an API Client

For us to utilize the client to the fullest, to be able to do all the request types (GET, POST, UPDATE, and so on), we will need to have an API client. There are a number out there, but we recommend either Postman (https://www.getpostman.com/) or Insomnia (https://insomnia.rest/). For our examples, we will be using Insomnia.

After installing Insomnia, add a GET request to http://localhost:8000:

  1. We will begin by creating a request page for Insomnia, where we will be making all of our requests:

Enter a name for the new request:

  1. We will then make our request by typing the route and clicking on Send:
When we change the type from GET to POST, and click on Send, we get a 404 error because, on our server, we currently have only the GET method defined for route /.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset