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
Original httpbin supports requests like /status/200,201,400 and /status/200:0.6,201:0.3,400:0.1, and will return a weighted random choice from the specified codes.
If specified, weights are parsed as floats, but there is no requirement that they sum to 1.0 or are otherwise limited to any particular range (see weighted_choice implementation)
The text was updated successfully, but these errors were encountered:
mccutchen
added
the
compat
Tracking issues around compatibility with original httpbin implementation
label
Sep 7, 2023
Fixes compatibility with the original httpbin by making the /status
endpoint accept multiple, optionally weighted status codes to choose
from.
Fixes#145.
Fixes compatibility with the original httpbin by making the `/status`
endpoint accept multiple, optionally weighted status codes to choose
from. Per the description in #145, this implementation attempts to match
original httpbin's behavior:
- If not specified, weight is 1
- If specified, weights are parsed as floats, but there is no
requirement that they sum to 1.0 or are otherwise limited to any
particular range
Fixes#145.
Original httpbin supports requests like
/status/200,201,400
and/status/200:0.6,201:0.3,400:0.1
, and will return a weighted random choice from the specified codes.Some quick notes on the upstream implementation:
weighted_choice
implementation)The text was updated successfully, but these errors were encountered: