1、Content-Type即MIME Type,资源的媒体类型,用于客户端(通常是浏览器)与服务器端进行消息内容格式的声明
2、HTTP协议中常用的Content-Type
text/htmltext/plain
text/xml
image/gif
image/jpeg
image/png
application/xml
application/json
application/octet-stream:二进制数据流(如常见的文件下载)
// 表单提交
application/x-www-form-urlencoded:Form表单数据被编码为key/value格式发送到服务器,默认选项
3、Spring MVC中相关注解
@RequestBody 一般用来处理非Content-Type:application/x-www-form-urlencoded编码格式的数据
本文详细介绍了Content-Type的概念及其在HTTP协议中的应用,列举了常见的Content-Type类型,并解释了它们如何用于不同场景,例如文本、图片及表单数据的提交。
2234

被折叠的 条评论
为什么被折叠?



