14 lines
386 B
Python
14 lines
386 B
Python
import requests
|
|
|
|
def send_post_request():
|
|
url = "http://localhost:8000/example"
|
|
data = {"content": "Hello, WebSocket!"}
|
|
headers = {"Content-Type": "application/json"}
|
|
|
|
response = requests.post(url, json=data, headers=headers)
|
|
print(f"Status Code: {response.status_code}")
|
|
print(f"Response: {response.json()}")
|
|
|
|
if __name__ == "__main__":
|
|
send_post_request()
|