Zest.

Python: HTTP POST JSON

A short, tested Python example for http post json. Copy it and adjust the names and paths for your project.

Python
import requests

r = requests.post("https://api.example.com/items", json={"name": "Zest"}, timeout=10)
print(r.status_code, r.json())

Find it in Zest

Search for “python http post json” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.

More Python examples

All Python examples