[PR #65] [MERGED] Use 'Retry-After' header if present. #747

Closed
opened 2026-02-28 00:01:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/spotipy-dev/spotipy/pull/65
Author: @bentappin
Created: 9/24/2015
Status: Merged
Merged: 12/31/2016
Merged by: @plamere

Base: masterHead: retry-after


📝 Commits (1)

  • aecd392 Use 'Retry-After' header if present.

📊 Changes

1 file changed (+14 additions, -6 deletions)

View changed files

📝 spotipy/client.py (+14 -6)

📄 Description

When the Web API responds with a status code of 429 it sets the Retry-After header to let you know how long to wait before retrying. https://developer.spotify.com/web-api/user-guide/#rate-limiting

This PR honours that header and defaults back to the original delay variable if not present.

requests headers use a case insensitive dictionary so we don't have to worry about the case that Spotify respond with.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/spotipy-dev/spotipy/pull/65 **Author:** [@bentappin](https://github.com/bentappin) **Created:** 9/24/2015 **Status:** ✅ Merged **Merged:** 12/31/2016 **Merged by:** [@plamere](https://github.com/plamere) **Base:** `master` ← **Head:** `retry-after` --- ### 📝 Commits (1) - [`aecd392`](https://github.com/spotipy-dev/spotipy/commit/aecd392c4a941e0445b1c044ad4035313ffac4a7) Use 'Retry-After' header if present. ### 📊 Changes **1 file changed** (+14 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `spotipy/client.py` (+14 -6) </details> ### 📄 Description When the Web API responds with a status code of `429` it sets the `Retry-After` header to let you know how long to wait before retrying. https://developer.spotify.com/web-api/user-guide/#rate-limiting This PR honours that header and defaults back to the original `delay` variable if not present. [requests headers](http://docs.python-requests.org/en/latest/api/#requests.Response.headers) use a case insensitive dictionary so we don't have to worry about the case that Spotify respond with. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:01:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#747
No description provided.