Repository navigation
feat: match httpbin.org on the open issues - #762
Merged
Merged
Conversation
/image answered 406 to an Accept header with */* in it, even though */* accepts any type, so curl-style clients got an error (#566). A */* range that isn't refused (q above 0) now gets the PNG, the same as no Accept header at all. The preference order is unchanged: webp, svg, jpeg, then png or image/*. avif-only and text/html-only still get 406. This is httpbin.org's behaviour. Co-Authored-By: Claude <noreply@anthropic.com>
Clients that append a path to the base URL they were given, such as /status/200/foo, got a 404 (#714). /status/{code}/{anything} now answers like /status/{code}, for every method the route takes, as on httpbin.org. A bad code is still a 400. Co-Authored-By: Claude <noreply@anthropic.com>
/status/{code} answers with an empty body, so a client can't test how it
shows an error page (#627). With ?body=1 (or true), the response carries
the code's standard reason phrase: {"code": 500, "description":
"Internal Server Error"} when Accept prefers application/json, and
"500 Internal Server Error" as text/plain otherwise, with Vary: Accept.
The body is only ever the standard phrase, never anything the caller
sends. Without the flag nothing changes. Codes without a body (1xx, 204,
205, 304) and those with their own (402, 406, 418) are unchanged, and
redirect and auth headers are kept. This is httpbin.org's behaviour,
reason phrases included.
Co-Authored-By: Claude <noreply@anthropic.com>
A multipart form that repeats a file field, such as two files under "f", came back with only the first one, and every file was labelled with the first one's Content-Type (#682). The files echo now lists every file of the field in order, each with its own type in the data URL when it is binary. A single file is echoed as before. This matches httpbin.org. Co-Authored-By: Claude <noreply@anthropic.com>
QUERY is a safe HTTP method that carries a body, and clients were getting a 405 for it (#734). /anything, /anything/... and /delay/{n} now accept QUERY and echo it like POST: args, form, files, data and json, and "method": "QUERY" where the echo reports the method. Every other route still answers 405. This matches httpbin.org. Co-Authored-By: Claude <noreply@anthropic.com>
There was no way to see a request as the server received it: which method was sent (#522), or the Content-Type of each part of a multipart upload (#722). /dump/request returns the request in its HTTP/1.x form as text/plain: the request line, Host, then the other headers sorted by name, and the body. A chunked body is shown chunked. It answers every method, including ones no other route accepts. It is approximate: the WSGI server has already merged repeated headers and lost the original order and case of the names. Under gunicorn its output is byte-for-byte httpbin.org's for the same request. Co-Authored-By: Claude <noreply@anthropic.com>
Taken from feat/auth-cookies-cache (a4634df); the digest challenge without qop (public issue 592). Co-Authored-By: Claude <noreply@anthropic.com>
attr[HttpOnly], attr[SameSite], attr[Path], attr[Secure] and attr[Domain], the last only when it is the request host (public issue 508). Based on feat/auth-cookies-cache (9840bae); error_response is added here because that branch had it from the redirect-to work. Co-Authored-By: Claude <noreply@anthropic.com>
…ocumented - The basic, hidden basic, bearer and digest auth routes take GET, POST, PUT, DELETE, PATCH and TRACE, as httpbin.org does (public issue 508 context; supersedes PR 607). - /zstd returns the request echo compressed with zstd, like /gzip and /brotli (public issue 736). It uses the standard library on Python 3.14 and the optional backports.zstd package before that, and says 501 without either. - show_env is documented on the home page and in the spec (public issue 513), and the README says what httpbin is (public issue 691). Co-Authored-By: Claude <noreply@anthropic.com>
Regenerated both hashed lock files with the zstd extra (uv 0.13.8, the commands in their headers), so the tests exercise /zstd on 3.11 to 3.13. Nothing else changed in the locks. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # httpbin/core.py # httpbin/helpers.py # test_httpbin.py
POSTing a form to /redirect-to gave a 500 (#593): the url was only read from the query, and a missing one raised a KeyError. A non-numeric status_code made int() raise too. url and status_code are now read from a urlencoded or multipart form body as well (POST, PUT, PATCH, DELETE). A name the query has, in any case, wins, and files are skipped. A missing or empty url gets a 400 "missing required query parameter: url", and a non-numeric status_code a 400 "invalid status code: ...", both as JSON. The target checks and the allowlist apply to a form value as to a query one. This matches httpbin.org. Co-Authored-By: Claude <noreply@anthropic.com>
A /delay/{n} that wasn't a plain number, or was negative, raised in
float() or time.sleep() and gave a 500 (#746). n is now read as
httpbin.org reads it: a decimal or hex-float number of seconds, with
underscores allowed between digits. Anything else, an overflowing value
or a negative one gets a 400 JSON error "invalid duration: ...". The
10-second limit is unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
Clients timing these endpoints can now see what the server was asked to do: the initial delay, and for /drip the write duration and the pause between bytes, in milliseconds. This was requested in #560. /drip now spreads the bytes over the whole duration, pausing between bytes rather than after each one, so the last byte arrives at the end of the duration instead of one pause later. With no duration it writes everything at once. Durations count in whole milliseconds, as on httpbin.org. Co-Authored-By: Claude <noreply@anthropic.com>
/drip always sent a Content-Length, so there was no way to test a client against a slow chunked body (#479). With chunked=1 (or true) the Content-Length is left off and the server sends the body with Transfer-Encoding: chunked, as httpbin.org does. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
/json, /xml, /html, /robots.txt, /deny, /encoding/utf8 and /image (and its type routes) answer with their normal body and Content-Type under the given status, 200 to 599 where a body is allowed. 1xx, 204, 205 and 3xx, and anything that is not one plain number, get a fixed plain-text 400 that does not repeat the value. /response-headers takes status=N too: it is never sent as a header, and Location and Refresh are refused with it, so the answer is never a redirect. An unacceptable Accept on /image still answers 406 (public issue 612; as go-httpbin does). Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Nov 12, 2026
This was referenced Nov 12, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One branch for the open issues, each matching httpbin.org.
/status/{code}?body=1adds the reason phrase (Include body in /status responses #627),/status/200/fooignores the extra path (Allow status requests to ignore trailing path #714), and/imagewithAccept: */*serves the PNG (not accept */* for /image #566).QUERYis accepted where a body is echoed ([Feat] Support forQUERYHTTP method #734), and/dump/requestreturns the request as text (Add /method endpoint for checking arbitrary HTTP methods #522, Add support for capturing the sent content-type in a multipart file upload #722)./redirect-toworks, and a missingurlor astatus_codethat isn't a number is a 400 instead of a 500 (POSTing to the /redirect-to results in 500 internal server error #593)./delay/abcand other bad durations are a 400 (Invalid delay parameter causes HTTP 500 in httpbin 0.10.4 #746)./delayand/dripsend aServer-Timingheader (Add server timing #560), and/drip?chunked=1sends the body chunked (Feature request: "chunked" header in /drip #479)./digest-auth/nonesends a challenge without qop (Setting for omitting 'qop' field in Digest response #592), and/cookies/setand/cookies/deletetakeattr[HttpOnly],attr[SameSite],attr[Path],attr[Secure]andattr[Domain](the last only when it is the request host) (Support for HttpOnly Cookies #508)./zstd, like/gzipand/brotli(/zstd endpoint #736). It needs Python 3.14, orbackports.zstd(in the lock files) before that.?status=Nworks on/json,/xml,/html,/robots.txt,/deny,/encoding/utf8and/image(200 to 599 where a body is allowed; anything else is a 400), and on/response-headers, whereLocationandRefreshare refused with it (Combining different types of request #612).show_envis documented on the home page and in the spec (documentshow_envparameter #513), and the README says what httpbin is (readme file does not explain what this service does #691).Generated with Claude Code