在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小解的更多相关文章

  1. Jsoup问题---获取http协议请求失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.

    Jsoup问题---获取http协议请求失败 1.问题:用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不 ...

  2. Jsoup获取部分页面数据失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.

    用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不符合要求. 请求代码如下: private static ...

  3. SharePoint自动化系列——Add content type to list.

    转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 将创建好的content type(若是跨web application需要事先publish c ...

  4. SharePoint自动化系列——Content Type相关timer jobs一键执行

    转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 背景: 在SharePoint Central Administration->Monito ...

  5. 转载 SharePoint【Site Definition 系列】– 创建Content Type

    转载原地址:  http://www.cnblogs.com/wsdj-ITtech/archive/2012/09/01/2470274.html Sharepoint本身就是一个丰富的大容器,里面 ...

  6. 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 ...

  7. 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 ...

  8. springboot 报错 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    开始 controller 方法写的是 @RequestMapping( value = "/add", method = RequestMethod.POST ) public ...

  9. .NET获取文件的MIME类型(Content Type)

    第一种:这种获取MIME类型(Content Type)的方法需要在.NET 4.5之后才能够支持,但是非常简单. 优点:方便快捷 缺点:只能在.NET 4.5之后使用 public FileResu ...

  10. 万能的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 ...

随机推荐

  1. background-clip、background-origin、box-sizing

    background-clip:border-box(默认).padding-box.content-box background-origin:border-box.padding-box(默认). ...

  2. 《JS权威指南学习总结--7.8 数组方法》

    内容要点: 一.join() Array.join()方法将数组中所有元素都转化为字符串并连接在一起,返回最后生产的字符串. 可以指定一个可选的字符串在生产的字符串中来分隔数组的各个元素.如果不指定分 ...

  3. 关于input在li列表中居中显示

    input属于置换元素(replaced element),置换元素主要是指img,input,textarea,select,object等这类默认就有CSS格式化外表范围的元素,这些元素的垂直居中 ...

  4. KindeEditor图片上传插件用法

    因业务需要找了款插件 KindeEditor编辑器确认挺好用,但无奈技术有限,上传配置不知,故问度娘! 图片上传对于部分新手来说有时候是一件非常头疼的事,今天来分享一下项目中使用到的这个插件Kinde ...

  5. hdu_5826_physics(物理题)

    题目链接:hdu_5826_physics 题意: 给你一些点的速度和初始位置,还有方向,这些速度和加速度满足v*a=c,然后又q个询问,问第t秒第K小的速度是多少 题解: 将物理公式转换为v与t的关 ...

  6. HUST 1339 Reversal(字符串)

    题目链接 题解:将每个单词倒置,可以用char数组,然后用空格分隔,这里用的是string和stringstream. #include <cstdio> #include <ios ...

  7. 文件断点续传原理与实现—— ESFramework 通信框架4.0 进阶(12)

    在ESFramework通信框架 4.0 快速上手(13) -- 文件传送,如此简单一文的详细介绍和ESFramework通信框架 4.0 快速上手(14) -- 聊天系统Demo,增加文件传送功能( ...

  8. 已知整数m,n,p,q适合(m-p)|(mn+pq)证明:(m-p)|(mq+np)(整除理论1.1.5)

    已知整数m,n,p,q适合(m-p)|(mn+pq)证明:(m-p)|(mq+np) 证明: 令(mn+pq)—(mq+np) =mn-np+pq-mq =n(m-p)+q(p-m) =(n-q)(m ...

  9. jq的siblings对a标签不起效

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  10. javascript显式类型的转换

    显式类型转换目的:为了使代码变得清晰易读,而做显示类型的转换常使用的函数:Boolean(),String(),Number()或Object()如:Nunber(5) //5String(true) ...