a
This commit is contained in:
@@ -20,7 +20,7 @@ payload = {
|
||||
def get_data():
|
||||
data = json.dumps(payload).encode("utf-8")
|
||||
|
||||
req = urllib.request.Request(
|
||||
req = request.Request(
|
||||
url,
|
||||
headers={"Content-Type": "application/json"},
|
||||
data=data,
|
||||
@@ -28,7 +28,7 @@ def get_data():
|
||||
)
|
||||
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=10) as response:
|
||||
with request.urlopen(req, timeout=10) as response:
|
||||
data = response.read()
|
||||
json_data = json.loads(data)
|
||||
print(json_data)
|
||||
|
||||
Reference in New Issue
Block a user