-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal_api.py
38 lines (30 loc) · 723 Bytes
/
local_api.py
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
36
37
38
import json
import requests
# TODO: send a GET using the URL http://127.0.0.1:8000
r = # Your code here
# TODO: print the status code
# print()
# TODO: print the welcome message
# print()
data = {
"age": 37,
"workclass": "Private",
"fnlgt": 178356,
"education": "HS-grad",
"education-num": 10,
"marital-status": "Married-civ-spouse",
"occupation": "Prof-specialty",
"relationship": "Husband",
"race": "White",
"sex": "Male",
"capital-gain": 0,
"capital-loss": 0,
"hours-per-week": 40,
"native-country": "United-States",
}
# TODO: send a POST using the data above
r = # Your code here
# TODO: print the status code
# print()
# TODO: print the result
# print()