Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ahmetb/go-httpbin
/ functions
Functions
94 in github.com/ahmetb/go-httpbin
⨍
Functions
94
◇
Types & classes
16
↓ 42 callers
Function
testServer
()
handlers_test.go:32
↓ 14 callers
Function
writeErrorJSON
(w http.ResponseWriter, err error)
util.go:18
↓ 12 callers
Function
get
(t *testing.T, url string)
handlers_test.go:63
↓ 11 callers
Function
assertLocationHeader
(t *testing.T, u, expected string)
handlers_test.go:88
↓ 11 callers
Function
writeJSON
(w io.Writer, v interface{})
util.go:12
↓ 6 callers
Function
getHeaders
(r *http.Request)
util.go:23
↓ 6 callers
Function
noRedirectClient
()
handlers_test.go:37
↓ 4 callers
Function
noFollowGet
(cl *http.Client, u string)
handlers_test.go:44
↓ 3 callers
Method
Brightness
(x, y float64)
handlers.go:533
↓ 3 callers
Function
GetHandler
GetHandler returns user agent.
handlers.go:122
↓ 2 callers
Function
basicAuthHandler
(w http.ResponseWriter, r *http.Request, status int)
handlers.go:499
↓ 2 callers
Function
flattenValues
(uv url.Values)
util.go:39
↓ 2 callers
Function
getImg
()
handlers.go:604
↓ 2 callers
Function
noFollow
(method string, cl *http.Client, u string)
handlers_test.go:48
↓ 2 callers
Function
req
(t *testing.T, url, method string, body []byte)
handlers_test.go:71
↓ 1 callers
Function
getCookies
(cs []*http.Cookie)
util.go:31
↓ 1 callers
Function
parseData
(r *http.Request)
handlers.go:670
↓ 1 callers
Function
post
(t *testing.T, url string, body []byte)
handlers_test.go:67
Function
AbsoluteRedirectHandler
AbsoluteRedirectHandler returns a 302 Found response if n=1 pointing to /host/get, otherwise to /host/absolute-redirect/(n-1)
handlers.go:186
Function
BasicAuthHandler
BasicAuthHandler challenges with given username and password.
handlers.go:489
Function
BrotliHandler
BrotliHandler returns a Brotli-encoded response
handlers.go:447
Function
BytesHandler
BytesHandler returns n random bytes of binary data and accepts an optional 'seed' integer query parameter.
handlers.go:255
Function
CacheHandler
CacheHandler returns 200 with the response of /get unless an If-Modified-Since or If-None-Match header is provided, when it returns a 304.
handlers.go:393
Function
CookiesHandler
CookiesHandler returns the cookies provided in the request.
handlers.go:313
Function
DeflateHandler
DeflateHandler returns a DEFLATE-encoded response.
handlers.go:429
Function
DelayHandler
DelayHandler delays responding for min(n, 10) seconds and responds with /get endpoint
handlers.go:281
Function
DeleteCookiesHandler
DeleteCookiesHandler deletes cookies with provided query value keys in the response by settings a Unix epoch expiration date and returns a 302 redirec
handlers.go:337
Function
DenyHandler
DenyHandler returns a plain-text response.
handlers.go:472
Function
DripHandler
DripHandler drips data over a duration after an optional initial delay, then optionally returns with the given status code.
handlers.go:353
Function
ExampleGetMux_httptest
()
example_test.go:13
Function
ExampleGetMux_server
()
example_test.go:32
Function
GIFHandler
GIFHandler returns an animated GIF image. Source: http://tech.nitoyon.com/en/blog/2016/01/07/go-animated-gif-gen/
handlers.go:544
Function
GZIPHandler
GZIPHandler returns a GZIP-encoded response
handlers.go:410
Function
GetMux
GetMux returns the mux with handlers for httpbin endpoints registered.
handlers.go:43
Function
HTMLHandler
HTMLHandler returns some HTML response.
handlers.go:518
Function
HeadersHandler
HeadersHandler returns user agent.
handlers.go:115
Function
HiddenBasicAuthHandler
HiddenBasicAuthHandler challenges with given username and password and returns 404 if authentication fails.
handlers.go:495
Function
HomeHandler
HomeHandler serves static HTML content for the index page.
handlers.go:83
Function
IPHandler
IPHandler returns Origin IP.
handlers.go:100
Function
JPEGHandler
JPEGHandler returns a JPEG image.
handlers.go:595
Function
PNGHandler
PNGHandler returns a PNG image.
handlers.go:600
Function
PostHandler
PostHandler accept a post and echo its data back
handlers.go:137
Function
RedirectHandler
RedirectHandler returns a 302 Found response if n=1 pointing to /get, otherwise to /redirect/(n-1)
handlers.go:170
Function
RedirectToHandler
RedirectToHandler returns a 302 Found response pointing to the url query parameter
handlers.go:203
Function
RobotsTXTHandler
RobotsTXTHandler returns a robots.txt response.
handlers.go:466
Function
SetCacheHandler
SetCacheHandler sets a Cache-Control header for n seconds and returns with the /get response.
handlers.go:403
Function
SetCookiesHandler
SetCookiesHandler sets the query key/value pairs as cookies in the response and returns a 302 redirect to /cookies.
handlers.go:321
Function
StatusHandler
StatusHandler returns a proper response for provided status code
handlers.go:210
Function
StreamHandler
StreamHandler writes a json object to a new line every second.
handlers.go:294
Function
TestAbsoluteRedirect
(t *testing.T)
handlers_test.go:194
Function
TestBasicAuthHandler_badCreds
(t *testing.T)
handlers_test.go:631
Function
TestBasicAuthHandler_correctCreds
(t *testing.T)
handlers_test.go:643
Function
TestBasicAuthHandler_noAuth
(t *testing.T)
handlers_test.go:621
Function
TestBrotli
(t *testing.T)
handlers_test.go:574
Function
TestBytes_noSeed
(t *testing.T)
handlers_test.go:286
Function
TestBytes_seed
(t *testing.T)
handlers_test.go:296
Function
TestBytes_size
(t *testing.T)
handlers_test.go:267
Function
TestCache_ifModifiedSince
(t *testing.T)
handlers_test.go:480
Function
TestCache_ifNoneMatch
(t *testing.T)
handlers_test.go:493
Function
TestCache_none
(t *testing.T)
handlers_test.go:506
Function
TestCookies
(t *testing.T)
handlers_test.go:374
Function
TestDeflate
(t *testing.T)
handlers_test.go:554
Function
TestDelay_limited
(t *testing.T)
handlers_test.go:317
Function
TestDelay_supportsFloat
(t *testing.T)
handlers_test.go:306
Function
TestDeleteCookies
(t *testing.T)
handlers_test.go:427
Function
TestDeny
(t *testing.T)
handlers_test.go:611
Function
TestDrip_code
(t *testing.T)
handlers_test.go:467
Function
TestGIF
(t *testing.T)
handlers_test.go:765
Function
TestGZIP
(t *testing.T)
handlers_test.go:529
Function
TestGet
(t *testing.T)
handlers_test.go:140
Function
TestHTML
(t *testing.T)
handlers_test.go:705
Function
TestHeaders
(t *testing.T)
handlers_test.go:128
Function
TestHiddenBasicAuthHandler_badCreds
(t *testing.T)
handlers_test.go:673
Function
TestHiddenBasicAuthHandler_correctCreds
(t *testing.T)
handlers_test.go:685
Function
TestHiddenBasicAuthHandler_noAuth
(t *testing.T)
handlers_test.go:663
Function
TestHome
(t *testing.T)
handlers_test.go:96
Function
TestIP
(t *testing.T)
handlers_test.go:104
Function
TestJPEG
(t *testing.T)
handlers_test.go:753
Function
TestPNG
(t *testing.T)
handlers_test.go:777
Function
TestPost
(t *testing.T)
handlers_test.go:159
Function
TestRedirect
(t *testing.T)
handlers_test.go:184
Function
TestRedirectTo
(t *testing.T)
handlers_test.go:204
Function
TestRobotsTXT
(t *testing.T)
handlers_test.go:598
Function
TestSetCache_none
(t *testing.T)
handlers_test.go:517
Function
TestSetCookies
(t *testing.T)
handlers_test.go:402
Function
TestStatus_3xxLocationHeader
(t *testing.T)
handlers_test.go:253
Function
TestStatus_assertValidCodes
(t *testing.T)
handlers_test.go:213
Function
TestStatus_invalidCodeWorks
(t *testing.T)
handlers_test.go:242
Function
TestStream
(t *testing.T)
handlers_test.go:332
Function
TestUserAgent
(t *testing.T)
handlers_test.go:116
Function
TestXML
(t *testing.T)
handlers_test.go:719
Function
UserAgentHandler
UserAgentHandler returns user agent.
handlers.go:108
Function
XMLHandler
XMLHandler returns some XML response.
handlers.go:524
Function
main
()
cmd/httpbin/main.go:15