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 ...
随机推荐
- JVM学习笔记:字节码执行引擎
JVM学习笔记:字节码执行引擎 移步大神贴:http://rednaxelafx.iteye.com/blog/492667
- ubuntu16.04+cuda7.5
0 安装了ubuntu16.04 GT980的显卡,安装了nvidia340的驱动 1 下载cuda7.5的.run文件 2 进入tty1,service stop lightdm 3 sudo sh ...
- 【BZOJ-3786】星系探索 Splay + DFS序
3786: 星系探索 Time Limit: 40 Sec Memory Limit: 256 MBSubmit: 647 Solved: 212[Submit][Status][Discuss] ...
- Nuget-使用图形化界面打包自己的类库
到NuGet相对于我们最重要的功能是能够搭建自己的NuGet服务器,实现公司内部类库的轻松共享更新.在安装好NuGet扩展后,我们已经能够通过NuGet轻松下载自己需要的类库,下面来说一说如何将自己的 ...
- BZOJ1049 [HAOI2006]数字序列0
本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000作者博客:http://www.cnblogs.com/ljh2000-jump/转 ...
- Linux修改密码passwd用法
语法: passwd [-k] [-l] [-u [-f]] [-d] [-S] [username] 必要参数:-d 删除密码-f 强制执行-k 更新只能发送在过期之后-l 停止账号使用-S 显示密 ...
- CTO、技术总监、首席架构师的区别
2016年11月30日13:22:26[转] CTO.技术总监.首席架构师的区别 提升自已的能力,比如专业技术,行业发展趋势,技术发展趋势,协调能力,组织能力,管理能力等[技术总监] 需要从技术总监和 ...
- javascript 代码可读性
可读性的大部分内容都是和代码缩进相关的,必须保证代码有良好的格式.可读性的另一方面就是注释,一般而言,有如下一些地方需要进行注释 1.1.1 函数和方法 每个函数或方法都应该包含一个注释,描述其目的和 ...
- java常用集合详解 contains
java集合是对常用数据集合的封装,差不多就是数组吧,验证某个元素是否在数据集合里,最原始的方法是,用个循环,"某个元素"与数据集合中的每个元素逐个进行比较. java 对常用的一 ...
- socketserver模块写的一个简单ftp程序
一坨需求... 用户加密认证 允许同时多用户登录 每个用户有自己的家目录 ,且只能访问自己的家目录 对用户进行磁盘配额,每个用户的可用空间不同 允许用户在ftp server上随意切换目录 (cd) ...