003_Http之response状态码
2016-02-27 15:01
393 查看
response状态码
1)100 还在发送
2)200 成功
3)320 重定向【重定向】
4)404 客户端错误 ,找不到访问的资源【客户端方面】
5)500 服务器错误【服务器方面】
响应的内容
200(状态码) OK
Content-Type:text/html;charset=utf-8 (响应头)
..........
<html>
xxxx
xxxxxx
xxxxx
xxx
</html>
response:其类型为HttpServletResponse
与协议没关的类型:ServletResponse
与协议相关的类型:HttpServletResponse
状态码:200表示成功、302表示重定向、404表示客户端错(访问的资源不存在)、500表示服务器端错
> sendError(int sc) --> 错误状态码,例如404、500
> sendError(int sc, String msg) -->错误状态码,带一个错误信息!
> setStatus(int sc) --> 成功,可以用来发送302
1)100 还在发送
2)200 成功
3)320 重定向【重定向】
4)404 客户端错误 ,找不到访问的资源【客户端方面】
5)500 服务器错误【服务器方面】
响应的内容
200(状态码) OK
Content-Type:text/html;charset=utf-8 (响应头)
..........
<html>
xxxx
xxxxxx
xxxxx
xxx
</html>
response:其类型为HttpServletResponse
与协议没关的类型:ServletResponse
与协议相关的类型:HttpServletResponse
状态码:200表示成功、302表示重定向、404表示客户端错(访问的资源不存在)、500表示服务器端错
> sendError(int sc) --> 错误状态码,例如404、500
> sendError(int sc, String msg) -->错误状态码,带一个错误信息!
> setStatus(int sc) --> 成功,可以用来发送302
相关文章推荐
- Z-stack 应用程序编程接口(API)-网络层
- OkHttp使用教程
- 002_Http之介绍
- VS2010创建并使用DLL http://www.cnblogs.com/laogao/archive/2012/12/07/2806528.html
- XMLHttpRequest cannot load 跨域问题解决
- 片上网络
- 片上网络
- 【转】iOS,Android网络抓包教程之tcpdump
- 太原网络营销师讲百度竞价(SEM)如何快速掌握上手公司的竞价账户?
- centos的nginx+https配置
- 神经网络分类
- Wireshark基本介绍和学习TCP三次握手
- httpclient以post方式发送body
- 如何查看自己电脑的IP和网络运营商
- [神经网络]2.1-How the backpropagation algorithm works-Warm up: a fast matrix-based approach ...(翻译)
- 自己写的一个简单的BP神经网络代码
- 安装andriod studio时出现Internal error. Please report to https://code.google.com/p/an
- okHttp的用法
- 使用windows2003多台服务器网络负载平衡注意事项
- 【高性能】Extreme交换机从头到尾配置