Programing

HTTP API 속도 제한 HTTP 응답 헤더의 예

crosscheck 2020. 10. 24. 09:37
반응형

HTTP API 속도 제한 HTTP 응답 헤더의 예


추가 HTTP 상태 코드 ( RFC6585 ) 중 하나는 다음과 같습니다.

이 HTTP 응답 상태에 유용한 HTTP / REST API 속도 제한 HTTP 응답 헤더의 예는 어디에서 찾을 수 있습니까?


다음은 HTTP API 속도 제한 HTTP 응답 헤더의 몇 가지 예입니다. 네 가지 일반적인 REST API : Github, Vimeo, Twitter 및 Imgur에서 가져옴 :

Github 속도 제한 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 속도 제한 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 속도 제한 https://dev.twitter.com/docs/rate-limiting/1.1

참고 : Twitter는 Vimeo와 같은 유사한 이름의 헤더를 사용하지만 각 이름에 대시가 있습니다.

#=============================#=============================================#
# 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 속도 제한 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                                    |
+-----------------------------+---------------------------------------------+

API 특정 헤더 외에도 겸손한 표준 Retry-After헤더를 잊지 마십시오 .

참고 URL : https://stackoverflow.com/questions/16022624/examples-of-http-api-rate-limiting-http-response-headers

반응형