http content-type总结

content-type 媒体类型,即MIME类型,包括媒体格式和编码两部分

例如:Content-Type:text/html;charset:utf-8

常见的媒体格式类型如下:

text/html : HTML格式
text/plain :纯文本格式
text/xml : XML格式
image/gif :gif图片格式
image/jpeg :jpg图片格式
image/png:png图片格式

以application开头的媒体格式类型:

application/xhtml+xml :XHTML格式
application/xml : XML数据格式
application/atom+xml :Atom XML聚合格式
application/json : JSON数据格式
application/pdf :pdf格式
application/msword : Word文档格式
application/octet-stream : 二进制流数据(如常见的文件下载)
application/x-www-form-urlencoded : <form encType=””>中默认的encType,form表单数据被编码为key/value格式发送到服务器(表单默认的提交数据的格式)
另外一种常见的媒体格式是上传文件之时使用的:

multipart/form-data : 需要在表单中进行文件上传时,就需要使用该格式

以上就是我们在日常的开发中,经常会用到的若干content-type的内容格式。

时间: 2024-08-08 17:33:56

http content-type总结的相关文章

org.springframework.web.HttpMediaTypeNotSupportedException: Content type &#39;application/json;charset=UTF-8&#39; not supported

踩到了一个神坑,明明@RequestMapping注解并没有设置consumes,即没有限定请求参数的类型.却出现文章底部的错误,原因竟然是同一个model下注解了两个@JsonBackReference. @Entity // 用户 public class User extends IDomain { @Column(columnDefinition = "varchar(255) comment '[电话]'") private String phone; @Column(col

Spring MVC 前后台传递json格式数据 Content type &#39;application/x-www-form-urlencoded;charset=UTF-8&#39; not supported

报错如下: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported 解决方案: 引入如下包: 问题既解决. Spring MVC 前后台传递json格式数据 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

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

转载原地址:  http://www.cnblogs.com/wsdj-ITtech/archive/2012/09/01/2470274.html Sharepoint本身就是一个丰富的大容器,里面存储的所有信息我们可以称其为“内容(Content)”,为了便于管理这些Conent,按照人类的正常逻辑就必然想到的是对此进行“分类”.分类所涉及到的层面又必然包括: 1.分类的标准或特征描述{即:类型属性(或:与该类型项目相关联的属性)}. 2.对应类的关联动作(即:工作流,行为以及其他设置)  

how to set default content type in document set in Sharepoint

I had encounter a issue when set default content type in document set, had to work around it Create a custom document set in library, besides I want the document set only contains a content type I want to use, hence add a custom content type in the d

InfoPath与SharePoint之(六)在表单库里引用InfoPath Form Content Type

在表单库里引用InfoPath Form Content Type 在上一篇,介绍了如何把InfoPath Form类型的Content Type发布到SiteCollection,发布完之后,就可以在已经存在的表单库里引用了. 打开一个已经存在的表单库,点击Ribbon上的Library Settings: 在Settings页面,点击Advanced Settings: 默认情况下,添加Content Type功能是关闭的,在这里开启: 再回到Library Settings页面,就可以添加

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

Jsoup问题---获取http协议请求失败 1.问题:用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不符合要求. 错误信息: Exception in thread "main" org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or applic

InfoPath与SharePoint之(五)发布InfoPath表单到Content Type

不管是在List里定制化表单,还是发布表单到Library,都有一个缺陷,就是不能被其他的List/Library重复使用. 因此SharePoint提供了一个功能,可以把表单发布成Content Type,这样其他的List/Library就可以引用它了. 打开之前设计的一个表单: 选择发布到SharePoint Server: 输入一个Site 的URL: 在类型这里,选择Content Type: 选择创建一个新的Content Type.如果以前发布过这个Content Type,现在要

the request doesn&#39;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 一,HTTP上传的基本知识 在Form元素的语法中,EncType表明提交数据的格式 用 Enctype 属性指定将数据回发到服务器时浏览器使用的编码类型.下边是说明: application/x-www-form-urlencoded: 窗体数据被编码为名称/值对.这是标准的编码格式. mult

org.springframework.web.HttpMediaTypeNotSupportedException: Content type &#39;application/json;charset=UTF-8&#39; not supported或其他Content type不支持处理

很久没从头到尾搭框架,今天搭的过程中,springmvc controller方法入参用@RequestBody自动绑定参数时一直提示各种 not supported 排查问题有两个解决路径: 1)使用post协议提交时,请检查Content type类型,如: $.ajax({ type: "POST", contentType: "application/json;charset=UTF-8", url: "/reg", data: JSON

CSOM创建Content Type并指定GUID

SharePoint 2013 Client Object Mode在创建Content Type时有一个限制,不能给Content Type指定一个GUID,只能由系统随机生成.而在用farm solution部署时,则可以在xml中指定好Content Type的GUID,或者用服务器端对象模型来指定GUID. SharePoint 2013 SP1发布之后,这个问题就迎刃而解了.在新的CSOM对象模型中,可以在创建Content Type时指定GUID.在o365上申请一个免费的开发网站,