it-swarm.com.de

Beispiele für HTTP-API-Ratenbeschränkungen für HTTP-Antwortheader

Einer der zusätzlichen HTTP-Statuscodes ( RFC6585 ) lautet

Wo finde ich Beispiele für HTTP/REST API Rate-Limiting HTTP-Antwortheader, die für diesen HTTP-Antwortstatus hilfreich sind?

72
M8R-1jmw5r

Im Folgenden finden Sie einige Beispiele für HTTP-API-Header zur Beschränkung der HTTP-Antwortrate. Entnommen aus vier gängigen REST APIs: Github, Vimeo, Twitter und Imgur:

Github-Ratenbegrenzung http://developer.github.com/v3/#rate-limiting

#=============================#=============================================#
# HTTP Header                 # Description                                 #
#=============================#=============================================#
| X-RateLimit-Limit           | Request limit per hour                      |
+-----------------------------+---------------------------------------------+
| X-RateLimit-Remaining       | The number of requests left for the time    |
|                             | window                                      |
+-----------------------------+---------------------------------------------+

Vimeo-Ratenbegrenzung http://developer.vimeo.com/guidelines/rate-limiting

#=============================#=============================================#
# HTTP Header                 # Description                                 #
#=============================#=============================================#
| X-RateLimit-Limit           | Request limit per day / per 5 minutes       |
+-----------------------------+---------------------------------------------+
| X-RateLimit-Remaining       | The number of requests left for the time    |
|                             | window                                      |
+-----------------------------+---------------------------------------------+
| X-RateLimit-Reset           | The remaining window before the rate limit  |
|                             | resets in UTC Epoch seconds                 |
+-----------------------------+---------------------------------------------+

Twitter REST API Rate Limiting https://dev.Twitter.com/docs/rate-limiting/1.1

Hinweis: Twitter verwendet Überschriften mit ähnlichen Namen wie Vimeo, hat jedoch einen anderen Gedankenstrich in jedem Namen.

#=============================#=============================================#
# HTTP Header                 # Description                                 #
#=============================#=============================================#
| X-Rate-Limit-Limit          | The rate limit ceiling for that given       |
|                             | request                                     |
+-----------------------------+---------------------------------------------+
| X-Rate-Limit-Remaining      | The number of requests left for the         |
|                             | 15 minute window                            |
+-----------------------------+---------------------------------------------+
| X-Rate-Limit-Reset          | The remaining window before the rate limit  |
|                             | resets in UTC Epoch seconds                 |
+-----------------------------+---------------------------------------------+

Imgur API Rate Limits http://api.imgur.com/

#=============================#=============================================#
# HTTP Header                 # Description                                 #
#=============================#=============================================#
| X-RateLimit-UserLimit       | Total credits that can be allocated         |
+-----------------------------+---------------------------------------------+
| X-RateLimit-UserRemaining   | Total credits available                     |
+-----------------------------+---------------------------------------------+
| X-RateLimit-UserReset       | Timestamp (unix Epoch) for when the credits |
|                             | will be reset                               |
+-----------------------------+---------------------------------------------+
| X-RateLimit-ClientLimit     | Total credits that can be allocated for the |
|                             | application in a day                        |
+-----------------------------+---------------------------------------------+
| X-RateLimit-ClientRemaining | Total credits remaining for the application |
|                             | in a day                                    |
+-----------------------------+---------------------------------------------+
116
M8R-1jmw5r

Vergessen Sie nicht, zusätzlich zu den API-spezifischen Headern, den bescheidenen Standard Retry-After Header.

24
Raedwald