From the course: Advanced Python: Practical Database Examples
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Call a new API using Postman - Python Tutorial
From the course: Advanced Python: Practical Database Examples
Call a new API using Postman
- [Instructor] Let's test our API. While we were able to make requests to the get endpoint using the browser, most of the time, we'll be using a special software to make API requests. In this case, we'll be using Postman, which is an API platform designed for developers to build and test their APIs. We can install it from the Postman website. Once it's installed, we can set up a collection that contains templates for each of our endpoints. Let's create one. We'll click new, collection. We'll call it Book APIs. Then we'll create a request to our POST API. You can left click on the collection or click the three dots. Add request. We'll call this one Add Book and save it to our collection. Notice it defaults to a get request, so we'll change it to post. For the request URL, we'll use the same host we used in the browser. The main difference is the route. So that's 127.0.0.1 at port 8,000. Then…
Contents
-
-
-
What is an API?2m 45s
-
(Locked)
API frameworks in Python1m 29s
-
(Locked)
Set up FastAPI in a Python application4m 6s
-
(Locked)
Define a database schema2m 56s
-
(Locked)
Create a MySQL database3m 45s
-
(Locked)
Create an API contract2m 22s
-
(Locked)
Build a POST endpoint with FastAPI2m 27s
-
(Locked)
Call a new API using Postman3m 35s
-
(Locked)
Add data to a database in Python using SQLAlchemy4m 45s
-
(Locked)
Integrate a database with a FastAPI application3m 33s
-
(Locked)
Challenge: Develop a GET endpoint with FastAPI and a DB1m 35s
-
(Locked)
Solution: Develop a GET endpoint with FastAPI and a Database7m 22s
-
-
-
-