// ok
header('HTTP/1.1 200 OK');
//设置一个404头:
header('HTTP/1.1 404 Not Found');
//设置地址被永久的重定向
header('HTTP/1.1 301 Moved Permanently');
//转到一个新地址
header('Location: http://www.example.org/');
//文件延迟转向:
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';
//当然,也可以使用html语法实现
// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By: PHP:
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');
//文档语言
header('Content-language: en');
//告诉浏览器最后一次修改时间
$time = time() - 60; // or filemtime($fn), etc
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
//告诉浏览器文档内容没有发生改变
header('HTTP/1.1 304 Not Modified');
//设置内容长度
header('Content-Length: 1234');
//设置为一个下载类型
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"');
header('Content-Transfer-Encoding: binary');
// load the file to send:
readfile('example.zip');
// 对当前文档禁用缓存
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Pragma: no-cache');
//设置内容类型:
header('Content-Type: text/html; charset=iso-8859-1');
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/plain'); //纯文本格式
header('Content-Type: image/jpeg'); //JPG***
header('Content-Type: application/zip'); // ZIP文件
header('Content-Type: application/pdf'); // PDF文件
header('Content-Type: audio/mpeg'); // 音频文件
header('Content-Type: application/x-shockw**e-flash'); //Flash动画
//显示登陆对话框
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="Top Secret"');
print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';
分享到:
相关推荐
详细分析php获取不到自定义header参数的原因,明确设置自定义header参数注意事项以及php获取自定义参数方法
magento处理不同的头部header
httpclient的用法,发送get请求和post请求,设置header
获得请求头的各种参数信息jsp代码: 客户使用的协议是: HTTP/1.1 获取接受客户提交信息的页面: /004.jsp 接受客户提交信息的长度: -1 客户提交信息的方式: GET 获取 HTTP 头文件中 User-Agent 的值:: ...
今天小编就为大家分享一篇java swagger ui 添加header请求头参数的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
修改chrome的请求头。 Header Editor是一款管理浏览器请求的Chrome扩展,包括修改请求头、修改响应头、重定向请求、取消请求。... 使用功能“修改请求头”或“修改响应头”时,将头内容设置为_header_editor_remove_
设置允许访问的域名: 1、允许全部的域名访问 header("Access-Control-Allow-Origin:*"); 2、允许指定域名访问 header( 'Access-Control-Allow-Origin:...然后根据需要再设置其他的参数。 以上就是通过header函
windows.open这个是JavaScript函数,但是在应用起来的时候总会遇到比较多的麻烦,因为参数非常多,用法也非常的多
开发网关项目时,在请求时往请求头header中放入了签名sign_key信息,在接收请求时再从header中拿出,在本地调试时是可以的,但上线之后通过Nginx代理之后发现拿不到。 location / { proxy_set_header X-Real-IP $...
response.setHeader 是用来设置返回页面的头 meta 信息, 使用时 response.setHeader( name, contect );
http请求服务单返回头部可选参数、含义、以及相关示例
主要讲解了如何利用window.open打开新窗口,和打开新窗口时的一些参数的设置,很实用的。
IE下页面打印控件 类似于ScriptX控件,但本控件可免费使用 ...2.自动设置各打印控制参数。 3.实现自动打印。 使用方法 控件的ID为clsid:AE1A309B-6FFA-4FCF-B07F-CB97FFD56B1B 使用Object标签包裹即可。 如 ...
windows平台上支持BITMAPCOREHEADER、BITMAPINFOHEADER、BITMAPV4HEADER、BITMAPV5HEADER四种类型位图的类库! 简单用法举例: DibBitmap bmp,ret,tmp; bmp.Open(_T("E:\\bmp.bmp"));//打开 bmp.ConvertBit(4,ret);...
在Web-service 调用SOAP 新增加SOAP的配置信息。用于验证用户信息。
delphi操作IdHTTP报头读写 delphi操作IdHTTP报头读写
在移动端的登录是原生的,但是h5也是有登录页面,这就需要控制token的过期时间了,但是想达到的网页访问使用网页的cookie,app登录使用的是app原生的登录token,在网页的cookie登录过期的时候,网页是可以正常退回...
某天,在需要抓取某个网页信息的时候,需要在header中增加一些信息,于是搜索了一下,如何在golang发起的http请求中设置header。 package main import ( "fmt" "io/ioutil" "net/http" "os" "encoding/json" )...
前言 本文介绍的是在PHP中用header(location:test.php)进行跳转要注意以下几点,有助于解决一些新手经常遇到的问题 一、location和“:”号...asp的redirect函数可以在向客户发送头文件后起作用. 如 <html><