diff options
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()) + |