Spaces:
Running
Running
Update app.py
Browse files51 unmodified lines52535455565758596061626364656651 unmodified lines# Capture all query parameters from the incoming requestquery_params = request.query_params# Encode the parameters for the new URLencoded_params = urlencode(query_params)# Construct the full URL for the private space endpointprivate_api_url = f"{api_url}/eins/?{encoded_params}"# check access token matchif 'key' in query_params and query_params['key'] == use_token:# Use httpx to make an asynchronous GET request to the private APItry:print('params', private_api_url)async with httpx.AsyncClient(timeout=60.0) as client:51 unmodified lines525354555657585960616263646566676851 unmodified lines# Capture all query parameters from the incoming requestquery_params = request.query_params# check access token matchif 'key' in query_params and query_params['key'] == use_token:# private API doesn't handle tokenquery_params.pop('key')# Encode the parameters for the new URLencoded_params = urlencode(query_params)# Construct the full URL for the private space endpointprivate_api_url = f"{api_url}/eins/?{encoded_params}"# Use httpx to make an asynchronous GET request to the private APItry:print('params', private_api_url)async with httpx.AsyncClient(timeout=60.0) as client:
app.py+9-7