Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Created Jul 17, 2019
Embed
What would you like to do?
Show HTTP status code constants for Go(net/http)
$ go doc -all net/http | awk '$1 ~ /Status/ && $2 == "=" {print}' | awk '{print $3, $1}'
100 StatusContinue
101 StatusSwitchingProtocols
102 StatusProcessing
200 StatusOK
201 StatusCreated
202 StatusAccepted
203 StatusNonAuthoritativeInfo
204 StatusNoContent
205 StatusResetContent
206 StatusPartialContent
207 StatusMultiStatus
208 StatusAlreadyReported
226 StatusIMUsed
300 StatusMultipleChoices
301 StatusMovedPermanently
302 StatusFound
303 StatusSeeOther
304 StatusNotModified
305 StatusUseProxy
307 StatusTemporaryRedirect
308 StatusPermanentRedirect
400 StatusBadRequest
401 StatusUnauthorized
402 StatusPaymentRequired
403 StatusForbidden
404 StatusNotFound
405 StatusMethodNotAllowed
406 StatusNotAcceptable
407 StatusProxyAuthRequired
408 StatusRequestTimeout
409 StatusConflict
410 StatusGone
411 StatusLengthRequired
412 StatusPreconditionFailed
413 StatusRequestEntityTooLarge
414 StatusRequestURITooLong
415 StatusUnsupportedMediaType
416 StatusRequestedRangeNotSatisfiable
417 StatusExpectationFailed
418 StatusTeapot
421 StatusMisdirectedRequest
422 StatusUnprocessableEntity
423 StatusLocked
424 StatusFailedDependency
425 StatusTooEarly
426 StatusUpgradeRequired
428 StatusPreconditionRequired
429 StatusTooManyRequests
431 StatusRequestHeaderFieldsTooLarge
451 StatusUnavailableForLegalReasons
500 StatusInternalServerError
501 StatusNotImplemented
502 StatusBadGateway
503 StatusServiceUnavailable
504 StatusGatewayTimeout
505 StatusHTTPVersionNotSupported
506 StatusVariantAlsoNegotiates
507 StatusInsufficientStorage
508 StatusLoopDetected
510 StatusNotExtended
511 StatusNetworkAuthenticationRequired
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment