Skip to content

Would like to parse RateLimit headers from successful response #1001

@ckantzer

Description

@ckantzer

Hello,
The Microsoft Sharepoint documentation recommends using the RateLimit headers to prevent throttling (429) errors. However, I can't seem figure out how to pull these headers from a successful 200 response.

Here is some sample I found on Google.
response = ctx.pending_request()._response
if response is not None:
remaining = response.headers.get("RateLimit-Remaining")
reset = response.headers.get("RateLimit-Reset")
print(f"RateLimit-Remaining: {remaining}, RateLimit-Reset: {reset}")

But the _responnse object is not defined on the pending_request.

Is there an update that allows these response headers to be parsed on a 200 response?

Thanks,
Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions