This is a service to help easily test the behaviour of HTTP clients like browsers, libraries, developer tools or anything else. Heavily inspired by the httpbin project. Canonical version available at httpbun.com, currently mirrored at httpbun.org as well.
★ Star this project on GitHub.
curl echo.basistheory.com/get
/put
, /patch
and /delete
endpoints that behave similarly.
curl -X POST -d 'one=1' echo.basistheory.com/post
curl -X POST -d '{"one": 1}' -H 'content-type:application/json' echo.basistheory.com/post
curl -X PUT echo.basistheory.com/put
curl -X PATCH echo.basistheory.com/patch
curl -X DELETE echo.basistheory.com/delete
headers
which is an object of all the headers in
the request, as keys and values. If a header repeats in the request, then its values are concatenated with a
comma and treated as a single header value.
curl -H 'x-custom: custom header value' echo.basistheory.com/headers
username
and password
as the credentials.
curl -H 'Authorization: Basic c2NvdHQ6dGlnZXI=' echo.basistheory.com/basic-auth/scott/tiger
Authorization
header in the request, that takes the
form Bearer some-auth-token-here
. If no expectedToken
is given, any token will be
treated as valid. If no Authorization
header is present in the request, this results in a 401
response.
curl -H 'Authorization: Bearer auth_token_here' echo.basistheory.com/bearer
curl -H 'Authorization: Bearer expected_token' echo.basistheory.com/bearer/expected_token
/digest-auth/auth/scott/tiger
requires to be authenticated with
the credentials scott
and tiger
as username and password. The implementation is based
on this example from Wikipedia. The value of qop
is usually equal to
auth
.
origin
, with the client's IP Address for value.
user-agent
, with the client's user agent (as
present in the User-Agent
header) for value.
If-Modified-Since
or If-None-Match
header, returns a 304
response. Otherwise, it behaves the same as /get
for GET requests,
/post
for POST requests, etc.
Cache-Control
header for age
seconds.codes
. It can be a comma-separated list of multiple
status codes, of which a random one is chosen for the response.
/response-headers?one=two
, there is a header called One
, whose value is
two
.
The response body contains all the headers again, in the form of a JSON object. (This JSON object in the
response should be considered deprecated, and may be removed in the future.)
seconds
seconds. The seconds
parameter has to be an integer
currently. Fractional delays are not yet supported.
*
character. The following query params can be used to configure this endpoint:
duration
: Time seconds over which to periodically drip the data. Default: 2.
numbytes
: Total number of times to drip the data. Default: 10.
code
: The HTTP status code to be used in their response. Default: 200.
delay
: An initial delay, in seconds. Default: 2.
/drip-lines
, a newline character is written after every piece of data.
count
links, which in turn respond with HTML documents with links
again. You mostly want to use the first version (i.e., without offset
).
count
random bytes, that are generated with the same random seed every time. The
value of count
is capped to 1000.
name
to value
.With Docker: docker run -p 8008:80 ghcr.io/sharat87/httpbun
With source: make run
localhost:3090
, which configures the server
to
listen on TCP port 3090 on localhost. It can also be set to unix//var/run/httpbun.sock
, which
configures the server to listen on the Unix socket located at /var/run/httpbun.sock
.HTTPBUN_BIND
environment variable.
/the-one
,
then
Httpbun's /get
endpoint will be available on /the-one/get
instead. Similarly, all
other
endpoints are also prefixed with the value of this argument.
empty
,
which means it will allow any. An example: httpbun.com,httpbun.org
.
1
, only accept connections coming in as https
. By default, https is not
forced.
1
, the endpoint /info
will be available, which responds with various server
information. By default, /info
returns a 404 Not Found
response.
X-One
is always
represented as X-One
, and never as x-one
or any other casing. This may change
in the future.
/get
, /post
, etc.
400 Bad Request
error,
instead of responding with a success, and empty body details like httpbin.
/headers
.
This is a feature of httpbin, but not httpbun. See
this list on httpbin.
Httpbun is distributed with the Apache-2.0 License. Please refer to the LICENSE and NOTICE files present in the source distribution of this project.
The bun icon was generated using the following graphics from Twitter Twemoji:
1fad3.svg
.