httpbin-go is a Go port of the popular requests/httpbin, and its corresponding Docker image kennethreitz/httpbin.
The original httpbin Docker container tips the scales at ~500MB, httpbin-go is >80x smaller (~6MB) and 10x faster (see performance comparison below).
httpbin-go
is an HTTP Request & Response Service, written in Go. Like the original httpbin
, httpbin-go
is an HTTP server that responds in predictable ways to a specified set of HTTP requests. For many endpoints the service echoes back much of the data given to it so that a developer can see what their HTTP client code is doing.
docker run -p 8080:8080 nathanows/httpbin-go
go build cmd/httpbin/main.go -o httpbin-go
go run httpbin-go
curl -v http://httpbin-go.com/get
TODO
Where possible, endpoint have been implemented to match the original implementation (specified here: https://httpbin.org/).
The following endpoints have not yet been implemented in this project:
-
/digest-auth/{qop}/{user}/{passwd}
[GET] -
/digest-auth/{qop}/{user}/{passwd}/{algorithm}
[GET] -
/digest-auth/{qop}/{user}/{passwd}/{algorithm}/{stale_after}
[GET] -
/brotli
[GET] -
/deflate
[GET] -
/gzip
[GET] -
/absolute-redirect/{n}
[GET] -
/redirect-to/{n}
[GET] -
/relative-redirect/{n}
[GET]
Click below to see the current implementation status of all endpoints:
Endpoint Implementation Status
/delete
[DELETE]/get
[GET]/patch
[PATCH]/post
[POST]/put
[PUT]
/basic-auth/{user}/{passwd}
[GET]/bearer
[GET]/digest-auth/{qop}/{user}/{passwd}
[GET]/digest-auth/{qop}/{user}/{passwd}/{algorithm}
[GET]/digest-auth/{qop}/{user}/{passwd}/{algorithm}/{stale_after}
[GET]/hidden-basic-auth/{user}/{passwd}
[GET]
/status/{codes}
[DELETE, GET, PATCH, POST, PUT]
/headers
[GET]/ip
[GET]/user-agent
[GET]
/cache
[GET]/cache/{value}
[GET]/etag/{etag}
[GET]/response-headers
[GET, POST]
/brotli
[GET]/deflate
[GET]/deny
[GET]/encoding/utf8
[GET]/gzip
[GET]/html
[GET]/json
[GET]/robots.txt
[GET]/xml
[GET]
/base64/{value}
[GET]/bytes/{n}
[GET]/delay/{delay}
[DELETE, GET, PATCH, POST, PUT]/drip
[GET]/links/{n}/{offset}
[GET]/range/{numbytes}
[GET]/stream-bytes/{n}
[GET]/stream/{n}
[GET]/uuid
[GET]
/cookies
[GET]/cookies/delete
[GET]/cookies/set
[GET]/cookies/set/{name}/{value}
[GET]
/image
[GET]/image/jpeg
[GET]/image/png
[GET]/image/svg
[GET]/image/webp
[GET]
/absolute-redirect/{n}
[GET]/redirect-to
[DELETE, GET, PATCH, POST, PUT]/redirect-to/{n}
[GET]/relative-redirect/{n}
[GET]
/anything
[DELETE, GET, PATCH, POST, PUT]/anything/{anything}
[DELETE, GET, PATCH, POST, PUT]
TODO
- Replicate all existing
httpbin
endpoints - Performance benchmarking
- Host public service at
www.httpbin-go.com
- Add TLS support
- Add swagger docs