在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. JObject对json的操作

    一,需去程序集添加using Newtonsoft.Json.Linq;引用 using System; using System.Collections.Generic; using System. ...

  2. 《JS权威指南学习总结--8.3 函数的实参和形参》

    内容要点: 一.可选形参 当调用函数的时候传入的实参比函数声明时指定的形参个数要少,剩下的形参都将设置为undefined值. 例如: //将对象o中可枚举的属性名追加至数组 //如果省略a,则创建一 ...

  3. spring security maven dependency

    Unable to locate Spring NamespaceHandler for XML schema namespace [ spring secutity dependency: < ...

  4. php 函数积累第一天

    htmlspecialchars 函数格式化表单输入的转化为html形式 exit - 输出一个消息并且退出当前脚本 list() 用一步操作给一组变量进行赋值. <?php$info = ar ...

  5. 基于Bootstrap的炫酷jQuery slider插件

    简要教程 这是一款在原生bootstrap slider的基础上制作效果非常炫酷的jQuery slider插件.该slider插件可以自定义slider的颜色.形状.透明度和tooltip等属性,美 ...

  6. Java IO 节点流 FileInput/OutputStream

    Java IO 节点流 FileInput/OutputStream @author ixenos 节点流之 文件流 文件读写是最常见的I/O操作,通过文件流来连接磁盘文件,读写文件内容 1.文件的读 ...

  7. 调用短信接口,先var_dump()看数据类型是object需要json_decode(json_encode( $resp),true)转换成array

    返回的数据.先看类型,如果是object类型 先json_encode, 再json_decode,加true 转换成数组 $resp = $c->execute($req); var_dump ...

  8. linux screen命令简易使用

    在Screen环境下,所有的会话都独立的运行,并拥有各自的编号.输入.输出和窗口缓存,方便在linux系统中后台执行程序. 安装,以centos为例: yum -y install screen 新建 ...

  9. 使用Slua框架开发Unity项目的重要步骤

    下载与安装 下载地址 GitHub 安装过程1.下载最新版,这里, 解压缩,将Assets目录里的所有内容复制到你的工程中,对于最终产品,可以删除slua_src,例子,文档等内容,如果是开发阶段则无 ...

  10. ebtables使用的协议

    ebtables的参数中: -p:指明使用的协议类型,ipv4,arp等可选(使用时必选)详情见/etc/ethertypes --ip-proto:IP包的类型,1为ICMP包,6为TCP包,17为 ...