`
everlxq
  • 浏览: 103252 次
  • 性别: Icon_minigender_1
  • 来自: 青岛
社区版块
存档分类
最新评论

Response.AddHeader的参数

 
阅读更多
Response.AddHeader的参数


response.setContentType("application/vnd.ms-excel");
  response.addHeader("content-disposition",
    "inline;  filename=abc.xls");//inline attachment有什么区别?
-------------
Response.AddHeader("content-type","application/x-msdownload");
Response.AddHeader("Content-Disposition","attachment;filename=要下载的文件名.rar");
刷新页面
Response.AddHeader “REFRESH”, ”60;URL=newpath/newpage.asp”
这等同于客户机端<META>元素:
<META HTTP-EQUIV=”REFRESH”, “60;URL=newpath/newpage.asp”
页面转向
Response.Status = “302 Object Moved”
Response.Addheader “Location”, “newpath/newpage.asp”
这等同于使用Response.Redirect方法:
Response.Redirect “newpath/newpage.asp”
强制浏览器显示一个用户名/口令对话框
Response.Status= “401 Unauthorized”
Response.Addheader “WWW-Authenticate”, “BASIC”
强制浏览器显示一个用户名/口令对话框,然后使用BASIC验证把它们发送回服务器(将在本书后续部分看到验证方法)。
如何让网页不缓冲
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.Addheader "pragma","no-cache"
Response.Addheader "cache-control","private"
Response.CacheControl = "no-cache
分享到:
评论

相关推荐

    网站保姆测试版 0.0.0.1

    Response.AddHeader("cache-ctrol", "no-cache"); string _xmlTmp = @"&lt;serverXML&gt;&lt;state&gt;$state$&lt;/state&gt;&lt;value&gt;$value$&lt;/value&gt;&lt;/serverXML&gt;"; if (Request.QueryString["loginTack"] != null && Request....

    excel-template-export.rar

    response.setHeader("Content-Disposition", "attachment;filename=" + new String((fileName + ".xls").getBytes(), "iso-8859-1")); //将文件输出到页面 ServletOutputStream out = response.getOutputStream...

    HttpConnectionTool工具类

    nvps.add(new BasicNameValuePair(key,value)); } httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); //将参数传入post方法中 response = httpclient.execute(httpost); //执行 Status...

    轻量级java web MVC框架

    response.addCookie(new Cookie("JSSESIONID", session.getId())); ServletOutputStream responseOutputStream = response.getOutputStream(); ImageIO.write(bufferImage, "JPEG", responseOutputStream); ...

    爬虫学习,一些实战

    爬虫学习,一些实战1.urllib.request模块urllib.request.urlopen一些参数1.urlRequest类headersRequest.add_header2.date一些函数geturl(),info(),getcode()response.read()2.urllib.parse模块urllib.parse....

    百度AI攻略:智能写诗.pdf

    access_token=" + access_token request = urllib.request.Request(url=url, data=params) request.add_header('Content-Type', 'application/json') response = urllib.request.urlopen(request) content = ...

    新浪微博授权代码及测试结果.zip

    httpRequest.addHeader(HEADER_AUTHO, HEADER_BASIC+user.encodeBase64NamePass()); //这里就是给用户的用户名和密码加密,然后放入http头 httpRequest.getParams().setBooleanParameter(CoreProtocolPNames.USE_...

    Android网络请求与下载框架NoHttp.zip

    request.addHeader("AppVersioin", "2.0"); // 添加请求参数 request.add("userName", "yolanda"); //上传文件 request.add("file", new FileBinary(file)); ...2.请求Json数据// JsonObject Request ...

    jmail发送邮件 asp.net使用jmail

     如:JMail.AddHeader( "Originating-IP","192.158.1.10" );  (17)AddRecipient(收件人):字符串  如:JMail.AddRecipient( "qiao198@hotmail.com" );  (18)AddRecipientBCC( Email ),密件收件人: ...

    ZendFramework中文文档

    6.3. 读取(Fetching)选项和参数 6.3.1. 操作 Getopt 异常 6.3.2. 通过名字读取 (Fetching)选项 6.3.3. 报告选项 6.3.4. 读取非选项参数 6.4. 配置 Zend_Console_Getopt 6.4.1. 添加选项规则 6.4.2. 添加...

    ASP.NET程序中常用的三十三种代码.txt

    =ListItemType.Header)  {  e.Item.Attributes.Add( "onmouseout","this.style.backgroundColor=\""+e.Item.Style["BACKGROUND-COLOR"]+"\"");  e.Item.Attributes.Add( "onmouseover","this.style....

    httpClient

    res.add(params1); params.put("result", res); String ret = doPost(url, params).toString(); System.out.println(ret); } /** httpClient的get请求方式2 * @return * @throws Exception */ public ...

    ASP.NET常用代码

    =ListItemType.Header) { e.Item.Attributes.Add( "onmouseout","this.style.backgroundColor=\""+e.Item.Style["BACKGROUND-COLOR"]+"\""); e.Item.Attributes.Add( "onmouseover","this.style.backgroundColor=\"...

    apache benchmark ab.exe

    -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip' Inserted after all normal header lines. (repeatable) -A attribute Add Basic WWW Authentication, the attributes are a colon ...

    Python使用post及get方式提交数据的实例

    最近在使用Python的过程中,发现网上很少提到在使用post方式时,怎么传一个数组作为参数的示例,此处根据自己的实践经验,给出相关示例: 单纯的post请求: ... req.add_header('Content-Type', 'app

    python爬虫课程要点.docx

    headers:请求头,字典类型,可以构造请求时直接通过headers参数构造,或通过add_header() 3)response:urlopen返回类型为HTTPResponse对象。 4)正则表达式:强大的字符串处理工具,有自己特定的语法结构,实现...

    检查网站是否存在 opensSSL

    options.add_option('-p', '--port', type='int', default=443, help='TCP port to test (default: 443)') def h2bin(x): return x.replace(' ', '').replace('\n', '').decode('hex') hello = h2bin(''' 16 03 ...

    jQuery完全实例.rar

    如果指定了 context 参数,如一个 DOM 元素集或 jQuery 对象,那就会在这个 context 中查找。 参考 Selectors 获取更多用于 expression 参数的 CSS 语法的信息。 ----------------------------------------------...

    java-servlet-api.doc

    当客户端发出请求时,Servlet引擎传递给Servlet一个ServletRequest对象和一个ServletResponse对象,这两个对象作为参数传递到service()方法中。 Servlet也可以执行ServletRequest接口和ServletResponse接口。...

Global site tag (gtag.js) - Google Analytics