demo_requests_post_json.py:
import requests url = 'https://www.w3schools.com/python/demopage.php' myjson = {'somekey': 'somevalue'} x = requests.post(url, json = myjson) #print the response text (the content of the requested file): print(x.text)
C:\Users\My Name>python demo_requests_post_json.py
<!DOCTYPE html>
<html>
<body>
<h1>This is a Test Page</h1>
</body>
</html>