NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
HTTP

HTTP协议及操作 更多...

struct  http_content
 HTTP内容类型定义 更多...
struct  http_method
 HTTP方法定义 更多...
struct  http_cookie_name
 HTTP Cookie名称定义 更多...

枚举

enum class  http_status : uint16_t {
  http_status::S1_CONTINUE = 100 , http_status::S1_SWITCH_PROTOCOL = 101 , http_status::S2_OK = 200 , http_status::S2_CREATED = 201 ,
  http_status::S2_NO_CONTENT = 204 , http_status::S2_PARTIAL_CONTENT = 206 , http_status::S3_MOVED_PERMANENT = 301 , http_status::S3_FOUND = 302 ,
  http_status::S3_NO_MODIFIED = 304 , http_status::S3_TEMPORARY_REDIRECT = 307 , http_status::S3_PERMANENT_REDIRECT = 308 , http_status::S4_BAD_REQUEST = 400 ,
  http_status::S4_UNAUTHORIZED = 401 , http_status::S4_FORBIDDEN = 403 , http_status::S4_NOT_FOUNT = 404 , http_status::S4_METHOD_NOT_ALLOWED = 405 ,
  http_status::S4_REQUEST_TIMEOUT = 408 , http_status::S4_PAYLOAD_LARGE = 413 , http_status::S4_URL_LONG = 414 , http_status::S4_MANY_REQUESTS = 429 ,
  http_status::S5_INTERNAL_ERROR = 500 , http_status::S5_BAD_GATEWAY = 502 , http_status::S5_SERVICE_UNAVAILABLE = 503 , http_status::S5_GATEWAY_TIMEOUT = 504 ,
  http_status::S5_HTTP_VERSION_NOT_SUPPORT = 505
}
 HTTP状态码枚举 更多...

详细描述

HTTP协议及操作

枚举类型说明

◆ http_status

enum class http_status : uint16_t
strong

HTTP状态码枚举

定义了标准的HTTP状态码,按响应类别分组:

  • 1xx:信息性状态码
  • 2xx:成功状态码
  • 3xx:重定向状态码
  • 4xx:客户端错误状态码
  • 5xx:服务器错误状态码
枚举值
S1_CONTINUE 

100 Continue 服务器收到请求头,客户端可以继续发送请求体

S1_SWITCH_PROTOCOL 

101 Switching Protocols 同意切换协议

S2_OK 

200 OK 请求成功

S2_CREATED 

201 Created 请求成功并创建了新资源

S2_NO_CONTENT 

204 No Content 请求成功但无内容返回

S2_PARTIAL_CONTENT 

206 Partial Content 部分请求成功(范围请求)

S3_MOVED_PERMANENT 

301 Moved Permanently 资源已永久迁移到新URL

S3_FOUND 

302 Found 资源临时迁移到新URL

S3_NO_MODIFIED 

304 Not Modified 资源未修改,可使用本地缓存

S3_TEMPORARY_REDIRECT 

307 Temporary Redirect 临时重定向

S3_PERMANENT_REDIRECT 

308 Permanent Redirect 永久重定向

S4_BAD_REQUEST 

400 Bad Request 请求格式错误

S4_UNAUTHORIZED 

401 Unauthorized 需要身份验证

S4_FORBIDDEN 

403 Forbidden 服务器拒绝请求

S4_NOT_FOUNT 

404 Not Found 请求的资源不存在

S4_METHOD_NOT_ALLOWED 

405 Method Not Allowed 请求方法不允许

S4_REQUEST_TIMEOUT 

408 Request Timeout 客户端请求超时

S4_PAYLOAD_LARGE 

413 Payload Too Large 请求体过大

S4_URL_LONG 

414 URI Too Long 请求URL过长

S4_MANY_REQUESTS 

429 Too Many Requests 请求次数过多

S5_INTERNAL_ERROR 

500 Internal Server Error 服务器内部错误

S5_BAD_GATEWAY 

502 Bad Gateway 上游服务器响应无效

S5_SERVICE_UNAVAILABLE 

503 Service Unavailable 服务暂时不可用

S5_GATEWAY_TIMEOUT 

504 Gateway Timeout 上游服务器响应超时

S5_HTTP_VERSION_NOT_SUPPORT 

505 HTTP Version Not Supported 不支持的HTTP版本

在文件 http_constants.hpp53 行定义.