-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch.py
More file actions
39 lines (23 loc) · 869 Bytes
/
fetch.py
File metadata and controls
39 lines (23 loc) · 869 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
36
37
38
39
import requests
# url = "https://wizard-world-api.herokuapp.com/Houses"
# response = requests.get(url)
# print(response.json())S
# response = requests.get(url)
# GANJAlf = {}
# for obj in response.json():
# name=obj.get('name')
# animal=obj.get('animal')
# GANJAlf[name]=animal
# print(name)
# print(GANJAlf)
# print(response.json())
#url = "https://wizard-world-api.herokuapp.com/Spells"
# params = {'name': 'Levitation Charm'}
# params = {'incantation': 'Wingardium Leviosa'}
#response = requests.get(url, params=params)
#print(response.json())
#how to pass headers to the request
# url = 'https://api.github.com/some/endpoint'
# headers = {'user-agent': 'my-app/0.0.1'}
# response = requests.get(url, headers=headers, headers=headers)
# https://wizard-world-api.herokuapp.com/swagger/index.html