(20250825) - changed lib aiohttps to httpx lib
This commit is contained in:
@@ -181,16 +181,20 @@ class PlacesController(GooglePlacesController):
|
|||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with aiohttp.ClientSession() as session:
|
async with httpx.AsyncClient(timeout=30) as client:
|
||||||
async with session.post(url, headers=headers, json=payload, timeout=30) as response:
|
response = await client.post(url, headers=headers, json=payload)
|
||||||
print(response)
|
print(response)
|
||||||
if response.status != 200:
|
|
||||||
|
if response.status_code != 200:
|
||||||
return False
|
return False
|
||||||
data = await response.json()
|
|
||||||
|
data = response.json()
|
||||||
print(data)
|
print(data)
|
||||||
|
|
||||||
# If key invalid, response will contain "error"
|
# If key invalid, response will contain "error"
|
||||||
if "error" in data:
|
if "error" in data:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user