php:Header
转自鸟哥的博客: http://www.laruence.com/2007/12/16/308.html
PHP header()
the function declaration: void header ( string string [, bool replace [, int http_response_code]])
The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type. By default it will replace(true);
RFC2616有相关的所有的状态信息的说明, 就状态码,大体总结如下:
* 1xx: Informational – Request received, continuing process
* 2xx: Success – The action was successfully received, understood,
and accepted
* 3xx: Redirection – Further action must be taken in order to
complete the request
* 4xx: Client Error – The request contains bad syntax or cannot be
fulfilled
* 5xx: Server Error – The server failed to fulfill an apparently
valid request
| “100″ ; Continue
| “101″ ; Switching Protocols
| “200″ ; OK
| “201″ ; Created
| “202″ ; Accepted
| “203″ ; Non-Authoritative Information
| “204″ ; No Content
| “205″ ; Reset Content
| “206″ ; Partial Content
| “300″ ; Multiple Choices
| “301″ ; Moved Permanently
| “302″ ; Moved Temporarily
| “303″ ; See Other
| “304″ ; Not Modified
| “305″ ; Use Proxy
| “400″ ; Bad Request
| “401″ ; Unauthorized
| “402″ ; Payment Required
| “403″ ; Forbidden
| “404″ ; Not Found
| “405″ ; Method Not Allowed
| “406″ ; Not Acceptable
| “407″ ; Proxy Authentication Required
| “408″ ; Request Time-out
| “409″ ; Conflict
| “410″ ; Gone
| “411″ ; Length Required
| “412″ ; Precondition Failed
| “413″ ; Request Entity Too Large
| “414″ ; Request-URI Too Large
| “415″ ; Unsupported Media Type
| “500″ ; Internal Server Error
| “501″ ; Not Implemented
| “502″ ; Bad Gateway
| “503″ ; Service Unavailable
| “504″ ; Gateway Time-out
| “505″ ; HTTP Version not supported
So, 举几个例子:
header(“HTTP/1.1 Not Found”, true, );
header(“HTTP/1.0 Unauthorized”);
header(“Content-Type: text/html; charset=utf-;”);
header(“Location:http://www.xxx.com”);
RFC2616 http://www.faqs.org/rfcs/rfc2616
php:Header的更多相关文章
- RestTemplate发送请求并携带header信息
1.使用restTemplate的postForObject方法 注:目前没有发现发送携带header信息的getForObject方法. HttpHeaders headers = new Http ...
- ABP Zero示例项目登录报错“Empty or invalid anti forgery header token.”问题解决
ABP Zero项目,登录时出现如图"Empty or invalid anti forgery header token."错误提示的解决方法: 在 WebModule.cs的P ...
- ASP.NET MVC 3 网站优化总结(三)Specify Vary: Accept-Encoding header
继续进行 ASP.NET MVC 3 网站优化工作,使用 Google Page 检测发现提示 You should Specify Vary: Accept-Encoding header,The ...
- .htaccess添加Header set Cache-Control报错500
在优化网站开启站点的图片缓存时,需要在.htaccess文件中加入: #文件缓存时间配置10分钟 <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf ...
- 如何实现可动态调整隐藏header的listview
(转自:http://blog.sina.com.cn/s/blog_70b9730f01014sgm.html) 需求:根据某种需要,可能需要动态调整listview的页眉页脚,譬如将header作 ...
- PHP header函数设置http报文头(设置头部域)
PHP HTTP 简介: HTTP 函数允许您在其他输出被发送之前,对由 Web 服务器发送到浏览器的信息进行操作. PHP 5 HTTP 函数:header() 向客户端发送原始的 HTTP ...
- 【HTML5&CSS3进阶学习02】Header的实现·CSS中的布局
前言 我们在手机上布局一般是这个样子的: 其中头部对整个mobile的设计至关重要,而且坑也很多: ① 一般来说整个header是以fixed布局,fixed这个产物在移动端来说本身坑就非常多 ② 在 ...
- webservice客户端添加soap Header信息
根据wsdl文件的header信息,在客户端中添加相应的header 1.wsdl信息如图 <soapenv:Envelope xmlns:soapenv="http://schema ...
- HTTP Header 详解
HTTP(HyperTextTransferProtocol)即超文本传输协议,目前网页传输的的通用协议.HTTP协议采用了请求/响应模型,浏览器或其他客户端发出请求,服务器给与响应.就整个网络资源传 ...
- java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.
分析:android 4.2.X及以下的版本,addHeaderView必须在setAdapter之前,否则会抛出IllegalStateException. android 4.2.X(API 17 ...
随机推荐
- BZOJ 3721: PA2014 Final Bazarek
3721: PA2014 Final Bazarek Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 645 Solved: 261[Submit][ ...
- js-JavaScript高级程序设计学习笔记1
第一章 1.一个完整的JavaScript实现应该由三个不同的部分组成:核心(ECMAScript).文档对象模型(DOM,提供访问和操作网页内容的方法和接口),浏览器对象模型(BOM,提供与浏览器交 ...
- Jenkins+CCNET的另类部署图
最近公司的CI系统升级,从CCNET换成Jenkins进行搭建,原因是Jenkins支持所有语言,不再是单一的dotnet语言支持,并且以节点的形式能做分布式自动构建,非常节省配置成功. 而且从MSB ...
- Irrelevant Elements, ACM/ICPC NEERC 2004, UVa1635
这种题目最重要的是思路了清晰 #include <cstdio> #include <cstring> ;//sqrt(n)+1 is enough ][]; ]; int a ...
- [iOS AFNetworking框架实现HTTP请求、多文件图片上传下载]
简单的JSON的HTTP传输就不说了,看一个简单的DEMO吧. 主要明白parameters是所填参数,类型是字典型.我把这部分代码封装起来了,以便多次调用.也许写在一起更清楚点. #pragma m ...
- excel处理数字的时候避免自动转为double
帮同事解决了一个POI解析Excel的功能,就是他想读出单元格中的原始内容,但是poi在处理数字的时候会自动转换为double了,这样对于一些对1和1.00有严格区分的场景下,会出现问题.我看网上很多 ...
- BZOJ1088: [SCOI2005]扫雷Mine
这道题A的好莫名其妙啊2333 传送门 状压DP,枚举上一个雷的分布情况(1<<3)-1,然后和当前的分布相结合,推出下一状态. //BZOJ 1088 //by Cydiater //2 ...
- bigdecimal类型数据的min方法
java.math.BigDecimal.min(BigDecimal val) 返回此BigDecimal和val的最小值. 声明 以下是java.math.BigDecimal.min()方法的声 ...
- Ajax Post 类实例
以前总是ajax请求是这样的 data:"a=1&b=2&c=3..." 而Controller也总是这样的 Action(int a,int b,int c) 很 ...
- ASP------ActioinResult之多种返回值
转载: http://www.cnblogs.com/jiagoushi/archive/2013/01/24/2875454.html http://www.cnblogs.com/lvcha/ar ...