响应头Content-Type与Content-Disposition的区别
本文参考文章:
- Content-Disposition
- Content-Disposition的作用与使用方法
Content-Type 实体头部用于指示资源的MIME类型,在响应中,Content-Type标头告诉客户端实际返回的内容的类型,指示客户端如何显示附加的文件。
Content-Disposition 是 MIME 协议的扩展,指示回复的内容该以何种形式展示,是以内联的形式(即网页或者页面的一部分,这种方式就与Content-Type指示显示相同),还是以附件的形式下载并保存到本地。
对于Content-Disposition,在HTTP场景中,第一个参数或者是inline(默认值,表示回复中的消息体会以页面的一部分或者整个页面的形式展示),或者是attachment(意味着消息体应该被下载到本地;大多数浏览器会呈现一个“保存为”的对话框,将filename的值预填为下载后的文件名,假如它存在的话)。
Content-Disposition: inline
Content-Disposition: attachment
Content-Disposition: attachment; filename="filename.jpg"
一般在响应设置响应的时候这两个头都要设置。
响应头Content-Type与Content-Disposition的区别相关推荐
- eclipse 设置 content type 编码格式
前言 Eclipse Version: 2019-12 (4.14.0) 操作 打开Preferences.菜单路径为:Window–> Preferences 在搜索框中输入:content ...
- SharePoint2010 内容类型剖析(Content Type/ 內容類型)
原文地址:http://sharepoint410.wordpress.com/2011/01/06/sharepoint2010-%E5%86%85%E5%AE%B9%E7%B1%BB%E5%9E% ...
- Error while extracting response for type [] and content type [],json返回值被解析为xml
在使用restTemplate请求restful接口时,在特定情况下总会将返回的json数据解析为xml数据然后处理,接着就会爆出标题中的错误: Error while extracting resp ...
- “Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported“解决方法
项目接口返回 code: 500 data: null message: "Content type 'application/x-www-form-urlencoded;charset=U ...
- Server returned HTTP response code 415 for URL , Content type text/plain charset=UTF-8 not support
客户端 http 请求报错 415,具体如下: Server returned HTTP response code: 415 for URL: http://ip:port/xxx 服务器端 用的是 ...
- Could not extract response: no suitable HttpMessageConverter found for content type [text/html]
目录 报错信息 源码分析 解决方法 修改 mappingJackson2HttpMessageConverter 配置 继承 mappingJackson2HttpMessageConverter 实 ...
- Media Type 媒体类型(MIME Type、Content Type)
媒体类型用于声明随之而来的数据的格式.又称:MIME类型.MIME Type.Content Type. 是一种用于在异构系统.分布式网络之间声明并传递信息主体格式的方法. 一般的,在文件系统中,我们 ...
- restTemplate http请求报错:no suitable HttpMessageConverter found for response type and content type
报错信息: org.springframework.web.client.UnknownContentTypeException: Could not extract response: no sui ...
- Posted content type isn't multipart/form-data
版权声明:欢迎转载,请注明沉默王二原创. https://blog.csdn.net/qing_gee/article/details/48712507 在有文件上传的表单提交过程中,搞不好就会报Po ...
- Maven报错解决:Element 'dependency' cannot have character [children], because the type's content type is
在用maven的时候遇到报错: Element 'dependency' cannot have character [children], because the type's content ty ...
最新文章
- Python之文件操作
- Spring MVC 4.1 支持jsonp
- PHP-fpm 优化问题
- super 与 this 关键字
- linux之ls只显示文件或者文件夹
- Debian GNU/Linux 的发展简史
- Android binder 框架和学习资料
- mysql不兼容_mysql5.7 不兼容问题
- python字典{:4}_升级您的Python技能:检查字典
- 【NOIP2004】【Luogu1088】火星人(枚举排列)
- 【kafka】多图解Kafka中的数据采集和统计机制
- request.setAttribute()与getParameter() 的区别
- 利用互斥对象实现线程同步的实例说明
- dos下载ftp文件linux,在DOS和LINUX下的FTP命令
- linux ping 不通 arp incomplete,关于show arp表,显示Incomplete问题
- MySQL 中的 repeate() 函数
- java闰年2月有多少_java计算两个时间相隔月数,考虑闰年
- 熊出没机器人光头强_《熊出没》中的这个小细节你注意到了吗?光头强或许只是诱饵...
- Scanner的.next()以及.nextLine()各自代表什么意思
- 是女人,请进来学学拍照姿势!
热门文章
- 儿童节搞笑祝福语短信
- 爱奇艺技术沙龙盘点(内含资料分享)
- Kafka消息队列 入门到精通 看这一篇就够了
- 查询win10电脑预装系统密钥(亲测)
- 南通数字孪生智能工厂可视化,3d可视化工业建模,数字工厂智能车间建设
- linux 编辑文件软件,Linux文本处理工具及Vim编辑器
- 考虑了全半角的SubString
- 【产品经理学习笔记】Part 1 产品体验及产品体验报告
- Win 10 开发中Adaptive磁贴模板的XML文档结构,Win10 应用开发中自适应Toast通知的XML文档结构...
- 【Java中常用的集合类】