ExerciseOCR/test/test2.py

14 lines
386 B
Python
Raw Normal View History

2024-10-25 12:53:51 +00:00
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()