You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/03_first_rest_api/05_make_request_to_rest_api/README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
---
2
2
title: How to interact with your REST API
3
3
description: Use Postman and Insomnia REST Client to interact with your REST API.
4
+
ctslug: how-to-interact-with-your-rest-api
4
5
---
5
6
6
7
# How to make a request to a REST API
@@ -28,11 +29,11 @@ Start by [downloading Insomnia REST Client](https://insomnia.rest/).
28
29
29
30
Once you've opened it, create a Project. I would call it "REST APIs with Flask and Python".
30
31
31
-

32
+

32
33
33
34
Then, create a new Request Collection. Call it "Stores REST API".
34
35
35
-

36
+

36
37
37
38
In the Request Collection, we can now add requests! Each request has a few parts:
Make a new request using the Insomnia interface. First, use the dropdown to start:
47
48
48
-

49
+

49
50
50
51
Then enter the request name. Leave the method as `GET`:
51
52
52
-

53
+

53
54
54
55
Once you're done, you will see your request in the collection:
55
56
56
-

57
+

57
58
58
59
Next up, enter the URL for your request. Here we will be requesting the `/store` endpoint. Remember to include your Base URL as well:
59
60
60
-

61
+

61
62
62
63
Once you're done, make sure that your Flask app is running! If it isn't, remember to activate your virtual environment first and then run the app:
63
64
@@ -74,6 +75,6 @@ If you get an error, read it carefully and make sure that no other Flask app is
74
75
75
76
Once your Flask app is running, you can hit "Send" on the Insomnia client, and you should see the JSON come back from your API!
76
77
77
-

78
+

78
79
79
80
If that worked and you can see your JSON, you're good to go! You've made your first API request. Now we can continue developing our REST API, remembering to always create new Requests in Insomnia and test our code as we go along!
0 commit comments