-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
35 lines (29 loc) · 900 Bytes
/
Copy pathtest.py
File metadata and controls
35 lines (29 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import requests
import json
## Define the URL of the Flask API
url = 'http://127.0.0.1:5000/api/v1/'
# Define the data you want to send in the POST request
data = {
'id': '40.0-2.5-1.0-7.0',
'sim_result': 150.4,
'runs': 6
}
# Send the POST request to the Flask API
response = requests.post(url+"send_sim_result", json=data)
# Print the response from the server
if response.status_code == 200:
print("Success:", response.json())
else:
print("Error:", response.json())
#response = requests.get(url+"get_sim_summary")
## Print the response from the server
#if response.status_code == 200:
# print("Success:", response.json())
#else:
# print("Error:", response.json())
#sim_id = "20.0-1.5-1.0-5.0"
#response = requests.get(url+f"get_sim_result/{sim_id}")
#if response.status_code == 200:
# print("Success:", response.json())
#else:
# print("Error:", response.json())