File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
code/daniel/lab08-dad_api Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 16
16
# response = requests.get(f"https://icanhazdadjoke.com/search?term=${search_term}", headers={
17
17
# 'Accept': 'application/json'
18
18
# })
19
- # ======================================================================================================
19
+ # ======================================================================================================
20
+
21
+
22
+ import requests
23
+
24
+ response = requests .get ("https://icanhazdadjoke.com" , headers = {'Accept' : 'application/json' })
25
+ joke = response .json ()
26
+
27
+ # print(response.url)
28
+ print (response .text )
29
+ print (response .json ())
30
+ print (joke )
31
+ # print(response.status_code)
32
+ # print(response.encoding)
33
+ # print(response.headers)
34
+
35
+
36
+ #========================================
37
+ # response = requests.get(f"https://icanhazdadjoke.com/search?term=${search_term}", headers={
38
+ # 'Accept': 'application/json'
39
+ # })
You can’t perform that action at this time.
0 commit comments