File size: 330 Bytes
838e061
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import requests

url = "http://localhost:5000"
headers = {"Content-Type": "application/json"}
data = {"message": "Hello, chatbot!"}

response = requests.post(url, json=data, headers=headers)

if response.status_code == 200:
    print("Chatbot response:", response.json().get("response"))
else:
    print("Error:", response.json())