Content-Type小解
在Http请求中,经常用Content-Type来定义网络文件的类型和网页的编码,在发送请求,返回数据时决定浏览器将以什么形式,什么编码来读取此文件。
常用类型:
text 文本类型
1.text/plain: 纯文本类型(plain:完全的)
2.text/xml: XML格式
3.text/html: HTML格式
image 图片类型
image/jpeg: jpg图片格式image/png: png图片格式
image/gif: gif图片格式
application
application/x-www-form-urlencoded: 表单提交中默认的提交方式 eg: <form encType= "x-www-form-urlencoded"></form> 表单内的数据将以键值对的格式发送到服务器
application/octet-stream: 二进制流数据(文件下载时多用) (octet 8字节)
application/json: JSON数据格式
application/xml: XML数据格式 (与text/xml 类似,区别在于text/html忽略xml文件头指定的编码方式而采用ASCII编码,application/xml则会按照xml指定的编码方式编码)
application/xhtml+xml: XHTML格式
application/atom+xml: Atom XML聚合格式
application/pdf: pdf格式
application/msword: Word文档格式
另外:
multipart/form-data: 当在表单提交中进行文件上传时,必须使用此格式
Content-Type小解的更多相关文章
- Jsoup问题---获取http协议请求失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.
Jsoup问题---获取http协议请求失败 1.问题:用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不 ...
- Jsoup获取部分页面数据失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.
用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不符合要求. 请求代码如下: private static ...
- SharePoint自动化系列——Add content type to list.
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 将创建好的content type(若是跨web application需要事先publish c ...
- SharePoint自动化系列——Content Type相关timer jobs一键执行
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 背景: 在SharePoint Central Administration->Monito ...
- 转载 SharePoint【Site Definition 系列】– 创建Content Type
转载原地址: http://www.cnblogs.com/wsdj-ITtech/archive/2012/09/01/2470274.html Sharepoint本身就是一个丰富的大容器,里面 ...
- the request doesn't contain a multipart/form-data or multipart/form-data stream, content type header
the request doesn't contain a multipart/form-data or multipart/form-data stream, content type header ...
- Springs Element 'beans' cannot have character [children], because the type's content type is element-only
Springs Element 'beans' cannot have character [children], because the type's content type is element ...
- springboot 报错 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
开始 controller 方法写的是 @RequestMapping( value = "/add", method = RequestMethod.POST ) public ...
- .NET获取文件的MIME类型(Content Type)
第一种:这种获取MIME类型(Content Type)的方法需要在.NET 4.5之后才能够支持,但是非常简单. 优点:方便快捷 缺点:只能在.NET 4.5之后使用 public FileResu ...
- 万能的ctrl+shift+F(Element 'beans' cannot have character [children], because the type's content type is element-only.错误)
今天在spring-servlet.xml文件中出现了一个莫名其妙的错误:Element 'beans' cannot have character [children], because the t ...
随机推荐
- win2008阿里一键环境包mysql老是1067报错
目前查看并不是染毒导致mysql无法启动,而是在mysql的配置文件中配置了log这个参数,这个参数语义不明确,请您将“--log”更改为general_log_file并添加一行“general_l ...
- bzoj4318: OSU!&&CF235BLet's Play Osu!
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=4318 4318: OSU! Time Limit: 2 Sec Memory Limit ...
- spoj1811:Longest Common Substrin
题目链接:http://begin.lydsy.com/JudgeOnline/problem.php?id=2796 把一个字符串做出后缀自动机,另一个字符串与之匹配. #include<cs ...
- What is Flux?
Pluralsight - React and Flux for Angular Developers 1. An architectural concept. It a idea. 2. Not a ...
- DX shader根据顶点设置颜色
matrix ViewProjMatrix; vector Blue = {0.0f, 0.0f, 1.0f, 0.0f}; struct VS_INPUT { vector position : P ...
- HDU 1009 FatMouse' Trade(贪心)
FatMouse' Trade Problem Description FatMouse prepared M pounds of cat food, ready to trade with the ...
- FZU 2086 餐厅点餐
好久不写博客了……得有快一个月了……看到大神们一篇篇博文 唉……差好多……这一个月 有蓝桥杯还有校赛……校赛签到题都没签完 实力铁牌……不过蓝桥杯一等奖 五月份帝都之行还挺令人期待……清明小长假之前 ...
- 创建 .gitignore 文件过滤规
文件 .gitignore 的格式规范如下: 所有空行或者以注释符号 # 开头的行都会被 Git 忽略. 可以使用标准的 glob 模式匹配. 匹配模式最后跟反斜杠(/)说明要忽略的是目录. 要忽略指 ...
- Python使用shape计算矩阵的行和列
shape函数是numpy.core.fromnumeric中的函数,它的功能是读取矩阵的长度. 1 >>> a=mat([[1,2,3],[5,6,9]]); 2 >> ...
- Laravel框架开发规范-修订前期版
1.追加App/Models目录,App/User.php迁移至App/Models目录中 ①配置内容属于架构信息.服务器信息.有必要隐藏无法提交git的信息,请使用.env文件配合env()方法进行 ...