HTTP所有状态代码及其定义

所有 HTTP 状态代码及其定义。 
 代码  指示  
2xx  
成功  
200  
正常;请求已完成。  
201  
正常;紧接 POST 命令。  
202  
正常;已接受用于处理,但处理尚未完成。  
203  
正常;部分信息 — 返回的信息只是一部分。  
204  
正常;无响应 — 已接收请求,但不存在要回送的信息。  
3xx  
重定向  
301  
已移动 — 请求的数据具有新的位置且更改是永久的。  
302  
已找到 — 请求的数据临时具有不同 URI  
303  
请参阅其它 — 可在另一 URI 下找到对请求的响应,且应使用 GET 方法检索此响应。  
304  
未修改 — 未按预期修改文档。  
305  
使用代理 — 必须通过位置字段中提供的代理来访问请求的资源。  
306  
未使用 — 不再使用;保留此代码以便将来使用。  
4xx  
客户机中出现的错误  
400  
错误请求 — 请求中有语法问题,或不能满足请求。  
401  
未授权 — 未授权客户机访问数据。  
402  
需要付款 — 表示计费系统已有效。  
403  
禁止 — 即使有授权也不需要访问。  
404  
找不到 — 服务器找不到给定的资源;文档不存在。  
407  
代理认证请求 — 客户机首先必须使用代理认证自身。  
415  
介质类型不受支持 — 服务器拒绝服务请求,因为不支持请求实体的格式。  
5xx  
服务器中出现的错误  
500  
内部错误 — 因为意外情况,服务器不能完成请求。  
501  
未执行 — 服务器不支持请求的工具。  
502  
错误网关 — 服务器接收到来自上游服务器的无效响应。  
503  
无法获得服务 — 由于临时过载或维护,服务器无法处理请求。
-----------------------------------------------------------------------------------------------------------------------
HTTP 400 - 
请求无效 
HTTP 401.1 - 
未授权:登录失败 
HTTP 401.2 - 
未授权:服务器配置问题导致登录失败 
HTTP 401.3 - ACL 
禁止访问资源 
HTTP 401.4 - 
未授权:授权被筛选器拒绝 
HTTP 401.5 - 
未授权:ISAPI  CGI 授权失败  
HTTP 403 - 
禁止访问 
HTTP 403 - 
 Internet 服务管理器 (HTML) 的访问仅限于 Localhost 
HTTP 403.1 
禁止访问:禁止可执行访问 
HTTP 403.2 - 
禁止访问:禁止读访问 
HTTP 403.3 - 
禁止访问:禁止写访问 
HTTP 403.4 - 
禁止访问:要求 SSL 
HTTP 403.5 - 
禁止访问:要求 SSL 128 
HTTP 403.6 - 
禁止访问:IP 地址被拒绝 
HTTP 403.7 - 
禁止访问:要求客户证书 
HTTP 403.8 - 
禁止访问:禁止站点访问 
HTTP 403.9 - 
禁止访问:连接的用户过多 
HTTP 403.10 - 
禁止访问:配置无效 
HTTP 403.11 - 
禁止访问:密码更改 
HTTP 403.12 - 
禁止访问:映射器拒绝访问 
HTTP 403.13 - 
禁止访问:客户证书已被吊销 
HTTP 403.15 - 
禁止访问:客户访问许可过多 
HTTP 403.16 - 
禁止访问:客户证书不可信或者无效 
HTTP 403.17 - 
禁止访问:客户证书已经到期或者尚未生效 
HTTP 404.1 - 
无法找到 Web 站点 
HTTP 404 - 
无法找到文件 
HTTP 405 - 
资源被禁止 
HTTP 406 - 
无法接受 
HTTP 407 - 
要求代理身份验证 
HTTP 410 - 
永远不可用 
HTTP 412 - 
先决条件失败 
HTTP 414 - 
请求 - URI 太长 
HTTP 500 - 
内部服务器错误 
HTTP 500.100 - 
内部服务器错误 - ASP 错误 
HTTP 500-11 
服务器关闭 
HTTP 500-12 
应用程序重新启动 
HTTP 500-13 - 
服务器太忙 
HTTP 500-14 - 
应用程序无效 
HTTP 500-15 - 
不允许请求 global.asa 
Error 501 - 
未实现 
HTTP 502 - 
网关错误 

504 - 网关超时。 

505 - HTTP 版本不受支持。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这里提供一份 Python 代码及其注释,用来求解八数码难题。 # 八数码难题代码及其注释 # 定义一个八数码类 class EightPuzzle: # 初始化函数,输入初始状态和目标状态 def __init__(self, init_state, goal_state): self.init_state = init_state self.goal_state = goal_state self.width = 3 # 定义八数码矩阵的宽度 self.actions = ['Up', 'Down', 'Left', 'Right'] # 定义可行的操作 # 定义状态转换函数,返回一个新状态 def move(self, state, action): new_state = state.copy() # 复制当前状态 index = new_state.index(0) # 找到空格的位置 if action == 'Up' and index > self.width - 1: new_state[index], new_state[index - self.width] = new_state[index - self.width], new_state[index] elif action == 'Down' and index < len(state) - self.width: new_state[index], new_state[index + self.width] = new_state[index + self.width], new_state[index] elif action == 'Left' and index % self.width != 0: new_state[index], new_state[index - 1] = new_state[index - 1], new_state[index] elif action == 'Right' and (index + 1) % self.width != 0: new_state[index], new_state[index + 1] = new_state[index + 1], new_state[index] else: return None # 如果操作不可行,返回 None return new_state # 定义状态比较函数 def state_equal(self, state1, state2): return state1 == state2 # 定义启发函数,使用曼哈顿距离 def heuristic(self, state): distance = 0 for i in range(self.width): for j in range(self.width): value = state[i * self.width + j] if value != 0: goal_i = (value - 1) // self.width goal_j = (value - 1) % self.width distance += abs(i - goal_i) + abs(j - goal_j) return distance # 定义 A* 算法 def A_star(self): open_list = [(self.init_state, 0, self.heuristic(self.init_state))] # 存储未扩展的结点,包括状态、代价和启发值 closed_list = [] # 存储已经扩展的结点 parent = {self.init_state: None} # 存储每个状态的父结点,用于还原路径 while open_list: current_state, current_cost, current_heuristic = min(open_list, key=lambda x: x[1] + x[2]) # 选择代价和启发值之和最小的结点进行扩展 open_list.remove((current_state, current_cost, current_heuristic)) closed_list.append(current_state) if self.state_equal(current_state, self.goal_state): # 如果当前状态为目标状态,则返回路径 path = [current_state] while parent[path[0]] is not None: path.insert(0, parent[path[0]]) return path for action in self.actions: # 扩展所有可行的操作 new_state = self.move(current_state, action) if new_state is not None and new_state not in closed_list: # 如果新状态可行且未被扩展过,则加入 open_list 中 new_cost = current_cost + 1 new_heuristic = self.heuristic(new_state) if (new_state, new_cost, new_heuristic) not in open_list: open_list.append((new_state, new_cost, new_heuristic)) parent[new_state] = current_state return None # 如果 open_list 为空,说明无法到达目标状态,返回 None # 测试代码 if __name__ == '__main__': init_state = [2, 8, 3, 1, 6, 4, 7, 0, 5] goal_state = [1, 2, 3, 8, 0, 4, 7, 6, 5] puzzle = EightPuzzle(init_state, goal_state) path = puzzle.A_star() if path is not None: for state in path: print(state) else: print('No solution')

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值