diff options
| author | Andrew Guschin <saintruler@gmail.com> | 2021-04-18 16:25:48 +0400 |
|---|---|---|
| committer | Andrew Guschin <saintruler@gmail.com> | 2021-04-18 16:25:48 +0400 |
| commit | 0ad35b9b50dfaa1083f3f5acc633ec769bc10e37 (patch) | |
| tree | 4acfde7b0b09fb258002055a8d0e2d5e1a9c5c3e /req.py | |
Initial commit
Diffstat (limited to 'req.py')
| -rw-r--r-- | req.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +import requests as req +from pprint import pprint + +r = req.get("http://localhost:8080/api/posts") +pprint(r.json()) + +data = {"id": 7, "title": "Some article", "body": "hey", "published": True} +r = req.post("http://localhost:8080/api/posts/add", json=data) +pprint(r.json()) + +data = {"id": 8, "title": "Some article", "body": "hey"} +r = req.post("http://localhost:8080/api/posts/add", json=data) +pprint(r.json()) + |