-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_request.py
39 lines (32 loc) · 1.04 KB
/
test_request.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
39
import requests
import json
def run_test_request(url: str):
resp = requests.get(url)
return resp
if __name__ == "__main__":
host = "http://127.0.0.1"
port = ":8009"
# episodes_id endpoint
postfix = "/series/tt2861424/episodes?season_num=4"
url = host+port+postfix
print("Requesting {}".format(url))
response = run_test_request(url)
print("{}\n".format(response.json()))
# top 250 series endpoint
postfix = "/top_250"
url = host+port+postfix
print("Requesting {}".format(url))
response = run_test_request(url)
print("{}\n".format(response.json()))
# top rated series endpoint
postfix = "/series/most_popular/12"
url = host+port+postfix
print("Requesting {}".format(url))
response = run_test_request(url)
print("{}\n".format(response.json()))
# newest series endpoint
postfix = "/series/newest/12"
url = host+port+postfix
print("Requesting {}".format(url))
response = run_test_request(url)
print("{}\n".format(response.json()))