[bb84f1]: / diabetes-api / test_request.py

Download this file

18 lines (14 with data), 311 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import requests
url = 'http://127.0.0.1:5000/predict'
data = {
"Pregnancies": 2,
"Glucose": 120,
"BloodPressure": 70,
"SkinThickness": 20,
"Insulin": 79,
"BMI": 25.5,
"DiabetesPedigreeFunction": 0.3,
"Age": 30
}
response = requests.post(url, json=data)
print(response.json())