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 ...
随机推荐
- LINQ里的“equals”和“==”的区别
对于值类型,如果对象的值相等,则相等运算符 (==) 返回 true,否则返回 false.对于string 以外的引用类型,如果两个对象引用同一个对象,则 == 返回 true.对于 string ...
- 老oj1965:polygon半平面交
题目链接:http://192.168.2.240:8080/JudgeOnline/showproblem?problem_id=1965 polygon半平面交 Time Limit:1000MS ...
- php的实参和形参
1.实参是调用函数时候的参数; 2.形参是声明函数时侯的参数, 例如 public function demo($a,$b) { return ; } 如果声明的函数如上,调用时dem ...
- C#实现文件的压缩和解压
这里主要解决文件夹包含文件夹的解压缩问题.1)下载SharpZipLib.dll,在http://www.icsharpcode.net/OpenSource/SharpZipLib/Download ...
- HttpModule的基本概念
注:本文为个人学习摘录,原文地址:http://www.cnblogs.com/stwyhm/archive/2006/08/09/471765.html HttpModule是如何工作的 当一个HT ...
- JS 之完美运动框架 如何同时改变元素多个属性?
正如改变一个属性的方法,可以使用已经写好的运动函数如move(obj,attr,target,fn);我们可能会想这样做, 调用两次运动函数,如同时改变宽和高,move(obj,'width',tar ...
- highstock
$(function () { $.getJSON('http://www.hcharts.cn/datas/jsonp.php?filename=aapl-ohlcv.json&callba ...
- 2015 ACM/ICPC Asia Regional Changchun Online
1001 Alisha’s Party 比赛的时候学长stl吃T.手写堆过. 赛后我贴了那两份代码都过.相差.2s. 于是用stl写水果. # include <iostream> # i ...
- Python 学习笔记12
不积跬步,无以至千里.不积小流,无以成江河. 当我觉得沮丧.绝望的时候,就疯狂的敲代码,这样会好受一点. 今天和昨天敲了两天的小程序,算是对python的具体语法规则有个初步的手熟. http://w ...
- UIScrollView 加载多个view view还可以交换顺序(2)
在上的代码中 UIview都在一个页面 要是每一个view对应一个页面 操作每一个view代码都在viewcontroller里面就会很乱,那么我们就将view重新做一下 创建想要的页面继承与view ...