You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-ietf-httpapi-ratelimit-headers.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,20 +138,22 @@ The term "problem type" in this document is to be interpreted as described in [P
138
138
139
139
# RateLimit-Policy Field {#ratelimit-policy-field}
140
140
141
-
The "RateLimit-Policy" response header field is a non-empty List{{SF}} of Quota Policy Items ({{quotapolicy-item}}). The Item{{SF}} value MUST be a Token{{SF}}.
141
+
The "RateLimit-Policy" response header field is a non-empty List{{SF}} of Quota Policy Items ({{quotapolicy-item}}). The Item{{SF}} value MUST be either a Token{{SF}} or a String{{SF}}.
142
142
143
143
The field value SHOULD remain consistent over a sequence of HTTP responses. It is this characteristic that differentiates it from the [RateLimit](#ratelimit-field) field that contains information that MAY change on every request. The "RateLimit-Policy" field enables clients to control their own flow of requests based on policy information provided by the server. Situations where throttling constraints are highly dynamic are better served using the [RateLimit field](#ratelimit-field) that communicates the latest service information a client can react to. Both fields can be communicated by the server when appropriate.
144
144
145
145
Lists of Quota Policy Items ({{quotapolicy-item}}) can be split over multiple "RateLimit-Policy" fields in the same HTTP response as described in {{Section 3.1 of SF}}.
A quota policy Item contains an identifier for the policy and a set of Parameters{{SF}} that contain information about a server's capacity allocation for the policy.
154
154
155
+
The policy identifier can be expressed as either a Token{{SF}} (unquoted) or a String{{SF}} (quoted). Tokens are more compact but are limited by Token syntax rules (e.g., cannot start with a digit, cannot contain spaces). Strings provide more flexibility by allowing any character sequence but require quotes.
156
+
155
157
The following parameters are defined:
156
158
157
159
q:
@@ -205,10 +207,10 @@ This field MAY convey the time window associated with the quota, as shown in thi
205
207
RateLimit-Policy: default;q=100;w=10
206
208
~~~
207
209
208
-
These examples show multiple policies being returned:
210
+
Policy identifiers can be expressed as Tokens (unquoted) or Strings (quoted). Both formats are acceptable and can be mixed:
The following example shows a policy with a partition key:
@@ -227,7 +229,7 @@ The following example shows a policy with a partition key and a quota unit:
227
229
228
230
A server uses the "RateLimit" response header field to communicate the current service limit for a quota policy for a particular partition key.
229
231
230
-
The field is expressed as a List{{SF}} of Service Limit Items ({{servicelimit-item}}). The Item{{SF}} value MUST be a Token{{SF}}.
232
+
The field is expressed as a List{{SF}} of Service Limit Items ({{servicelimit-item}}). The Item{{SF}} value MUST be either a Token{{SF}} or a String{{SF}}.
231
233
232
234
Lists of Service Limit Items can be split over multiple "RateLimit" fields in the same HTTP response as described in {{Section 3.1 of SF}}.
233
235
@@ -239,6 +241,8 @@ Lists of Service Limit Items can be split over multiple "RateLimit" fields in th
239
241
240
242
Each service limit Item{{SF}} identifies the quota policy ({{quotapolicy-item}}) associated with the request and contains Parameters{{SF}} with information about the current service limit.
241
243
244
+
The policy identifier can be expressed as either a Token{{SF}} (unquoted) or a String{{SF}} (quoted), matching the format used in the corresponding RateLimit-Policy field.
245
+
242
246
The following parameters are defined in this specification:
243
247
244
248
r:
@@ -294,10 +298,10 @@ This example shows a remaining quota of 999 requests for a partition key that ha
294
298
RateLimit: default;r=999;pk=:dHJpYWwxMjEzMjM=:
295
299
~~~
296
300
297
-
This example shows a 300MB remaining quota for an application in the next 60 seconds:
301
+
This example shows a 300MB remaining quota for an application in the next 60 seconds, using a quoted String identifier:
0 commit comments