当前位置:网站首页>go status. Go status code definition
go status. Go status code definition
2022-07-28 11:25:00 【It workers】
status.go Used a map Set defined http Response status code of
Specific references are as follows
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package http
// HTTP status codes, defined in RFC 2616.
const (
StatusContinue = 100
StatusSwitchingProtocols = 101
StatusOK = 200
StatusCreated = 201
StatusAccepted = 202
StatusNonAuthoritativeInfo = 203
StatusNoContent = 204
StatusResetContent = 205
StatusPartialContent = 206
StatusMultipleChoices = 300
StatusMovedPermanently = 301
StatusFound = 302
StatusSeeOther = 303
StatusNotModified = 304
StatusUseProxy = 305
StatusTemporaryRedirect = 307
StatusBadRequest = 400
StatusUnauthorized = 401
StatusPaymentRequired = 402
StatusForbidden = 403
StatusNotFound = 404
StatusMethodNotAllowed = 405
StatusNotAcceptable = 406
StatusProxyAuthRequired = 407
StatusRequestTimeout = 408
StatusConflict = 409
StatusGone = 410
StatusLengthRequired = 411
StatusPreconditionFailed = 412
StatusRequestEntityTooLarge = 413
StatusRequestURITooLong = 414
StatusUnsupportedMediaType = 415
StatusRequestedRangeNotSatisfiable = 416
StatusExpectationFailed = 417
StatusTeapot = 418
StatusPreconditionRequired = 428
StatusTooManyRequests = 429
StatusRequestHeaderFieldsTooLarge = 431
StatusUnavailableForLegalReasons = 451
StatusInternalServerError = 500
StatusNotImplemented = 501
StatusBadGateway = 502
StatusServiceUnavailable = 503
StatusGatewayTimeout = 504
StatusHTTPVersionNotSupported = 505
StatusNetworkAuthenticationRequired = 511
)
var statusText = map[int]string{
StatusContinue: "Continue",
StatusSwitchingProtocols: "Switching Protocols",
StatusOK: "OK",
StatusCreated: "Created",
StatusAccepted: "Accepted",
StatusNonAuthoritativeInfo: "Non-Authoritative Information",
StatusNoContent: "No Content",
StatusResetContent: "Reset Content",
StatusPartialContent: "Partial Content",
StatusMultipleChoices: "Multiple Choices",
StatusMovedPermanently: "Moved Permanently",
StatusFound: "Found",
StatusSeeOther: "See Other",
StatusNotModified: "Not Modified",
StatusUseProxy: "Use Proxy",
StatusTemporaryRedirect: "Temporary Redirect",
StatusBadRequest: "Bad Request",
StatusUnauthorized: "Unauthorized",
StatusPaymentRequired: "Payment Required",
StatusForbidden: "Forbidden",
StatusNotFound: "Not Found",
StatusMethodNotAllowed: "Method Not Allowed",
StatusNotAcceptable: "Not Acceptable",
StatusProxyAuthRequired: "Proxy Authentication Required",
StatusRequestTimeout: "Request Timeout",
StatusConflict: "Conflict",
StatusGone: "Gone",
StatusLengthRequired: "Length Required",
StatusPreconditionFailed: "Precondition Failed",
StatusRequestEntityTooLarge: "Request Entity Too Large",
StatusRequestURITooLong: "Request URI Too Long",
StatusUnsupportedMediaType: "Unsupported Media Type",
StatusRequestedRangeNotSatisfiable: "Requested Range Not Satisfiable",
StatusExpectationFailed: "Expectation Failed",
StatusTeapot: "I'm a teapot",
StatusPreconditionRequired: "Precondition Required",
StatusTooManyRequests: "Too Many Requests",
StatusRequestHeaderFieldsTooLarge: "Request Header Fields Too Large",
StatusUnavailableForLegalReasons: "Unavailable For Legal Reasons",
StatusInternalServerError: "Internal Server Error",
StatusNotImplemented: "Not Implemented",
StatusBadGateway: "Bad Gateway",
StatusServiceUnavailable: "Service Unavailable",
StatusGatewayTimeout: "Gateway Timeout",
StatusHTTPVersionNotSupported: "HTTP Version Not Supported",
StatusNetworkAuthenticationRequired: "Network Authentication Required",
}
// return httpcode Corresponding Status code description information
// Return an empty string to indicate the status code unknown
func StatusText(code int) string {
return statusText[code]
}
边栏推荐
- 1天涨粉81W,打造爆款短视频的秘诀是什么?
- Do data analysis, do you still not understand RFM analysis method (model)?
- Nodejs: mongodb simple fuzzy + paging query instance
- "Node learning notes" koa framework learning
- DHCP experiment demonstration (Huawei switch device configuration)
- 什么是WordPress
- Stacks and queues
- 1331. 数组序号转换
- Clo********e: project management notes
- C language uses double pointer to realize simple factory mode (polymorphism)
猜你喜欢
![Two point, three point, 01 point plan [bullet III]](/img/4c/a047440b4752c74c249d5e98bd4b3d.png)
Two point, three point, 01 point plan [bullet III]

1天涨粉81W,打造爆款短视频的秘诀是什么?
![[MySQL from introduction to proficiency] [advanced chapter] (IX) precautions for InnoDB's b+ tree index](/img/dc/2c11852929cc2ad4a2e44b87e6f812.png)
[MySQL from introduction to proficiency] [advanced chapter] (IX) precautions for InnoDB's b+ tree index

Summary of the second semester of junior year

18 diagrams, intuitive understanding of neural networks, manifolds and topologies

擦黑板特效表白H5源码+非常浪漫/附BGM

「学习笔记」树状数组

Learning notes tree array

leetcode:1300. 转变数组后最接近目标值的数组和【二分】

DHCP experiment demonstration (Huawei switch device configuration)
随机推荐
JWT 登录认证 + Token 自动续期方案,写得太好了!
Jianzhi offer 09. realize queue with two stacks
Generation and use of Lib library files in keil and IAR
C language to convert float data into BCD data
大三下学期总结
「Node学习笔记」Koa框架学习
Sword finger offer 06. print linked list from end to end
vim命令下显示行号[通俗易懂]
什么是WordPress
Leetcode:1300. the sum of the array closest to the target value after transforming the array [dichotomy]
Table data processing software, what else besides excel?
EC20/EC25 4G模块AT指令开发总结
万字详解 Google Play 上架应用标准包格式 AAB
Nodejs: detect and install the NPM module. If it is already installed, skip
Using C language to compile student achievement management system (C language student achievement management system deleted)
Encryption defect of icloud Keychain in Apple mobile phone
What's the secret of creating a popular short video?
Tree shaking and DCE
WPF依赖属性(wpf 依赖属性)
Relevant knowledge points of hash table