-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpy58.py
More file actions
51 lines (20 loc) · 809 Bytes
/
py58.py
File metadata and controls
51 lines (20 loc) · 809 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
40
41
42
43
44
45
46
47
48
49
50
51
""" API """
# pip install requests
import requests
#------------get--------------
response = requests.get('https://pokeapi.co/api/v2/pokemon/ditto')
print(response.url) # آدرس api
print(response.status_code) # گرفتن کد ریسپانس
print(response.request) # نوع ریسپانس get
print(response.reason) # وضعیت ریسپانس OK - Not Found
print(response.ok) # ریسپانس درست است؟ True - False
print(response.headers) # هدر ریسپانس
print(response.encoding) # نوع ساختار کد - utf-8
print(response.json()) # دریافت اطلاعات به صورت جیسان
print(dir(response))
print("#"*180)
print("#"*180)
print("#"*180)
#------------set--------------
#------------put--------------
#----------delete-------------