blob: d9951234dda60282d3f538e1b9e63280287595a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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())
|