Closed
Description
I would like to know how exploit the return of the server when an error 429 occurs.
I use this template to perform my gql requests:
async with Client(transport=transport) as session:
query = gql(query)
params = {params}
try:
result = await session.execute(query, variable_values=params)
except TransportServerError:
time.sleep(x_seconds)
I would like to set the x_seconds with the return of the server.
Whenever you perform too many requests, the server will answer with a 429 HTTP error code and add a 'Retry-After: TimeToWaitInSeconds' header to the response. (RFC: https://datatracker.ietf.org/doc/html/rfc6585#section-4)
Should I use the requests library to catch this parameter or can I use the gql library to catch it?
Thanks