转至:http://www.cnblogs.com/taoys/archive/2010/12/30/1922186.html

application/x-www-form-urlencoded: 窗体数据被编码为名称/值对。这是标准的编码格式。 

multipart/form-data: 窗体数据被编码为一条消息,页上的每个控件对应消息中的一个部分

text/plain: 窗体数据以纯文本形式进行编码,其中不含任何控件或格式字符。
 补充
form的enctype属性为编码方式,常用有两种:application/x-www-form-urlencoded和multipart/form-data,

默认为application/x-www-form-urlencoded。

当action为get时候,浏览器用x-www-form-urlencoded的编码方式把form数据转换成一个字串(name1=value1&name2=value2...),

然后把这个字串append到url后面,用?分割,加载这个新的url。 当action为post时候,浏览器把form数据封装到http body中,然后发送到server。

如果没有type=file的控件,用默认的application/x-www-form-urlencoded就可以了。 但是如果有type=file的话,就要用到multipart/form-data了。

浏览器会把整个表单以控件为单位分割,并为每个部分加上Content-Disposition(form-data或者file),Content-Type(默认为text/plain),name(控件name)

等信息,并加上分割符(boundary)。

关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related(转)的更多相关文章

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

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

  2. ajax使用向Spring MVC发送JSON数据出现 org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported错误

    ajax使用向Spring MVC发送JSON数据时,后端Controller在接受JSON数据时报org.springframework.web.HttpMediaTypeNotSupportedE ...

  3. jmeter报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported"的解决方法

    1.报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supporte ...

  4. Jmeter发送post请求报错Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    常识普及: Content-type,在Request Headers里面,告诉服务器,我们发送的请求信息格式,在JMeter中,信息头存储在信息头管理器中,所以在做接口测试的时候,我们维护Conte ...

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

    Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported告诉你,你的请求头是application/x- ...

  6. org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported

    最后找到我的问题,springmvc配置文件中没加 <mvc:annotation-driven/> java代码: @RequestMapping(value="/reques ...

  7. 接入WxPusher微信推送服务出现错误:Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    背景 使用WxPusher微信推送服务 ,可以及时的将服务的一些运行异常信息,发送到自己的微信上,方便了解服务的运行状态(PS:这个服务是免费的). 你可以在这里看到WxPusher微信推送服务的接入 ...

  8. Content type 'application/json;charset=UTF-8' not supported异常的解决过程

    首先说一下当时的场景,其实就是一个很简单的添加操作,后台传递的值是json格式的,如下图 ,后台对应的实体类, @Data @EqualsAndHashCode(callSuper = false) ...

  9. jersey处理支付宝异步回调通知的问题:java.lang.IllegalArgumentException: Error parsing media type 'application/x-www-form-urlencoded; text/html; charset=UTF-8'

    tcpflow以流为单位分析请求内容,非常适合服务器端接口类服务查问题 这次遇到的问题跟支付宝支付后的回调post结果有关 淘宝的代码例子: public void doPost(HttpServle ...

  10. solr异常--Expected mime type application/octet-stream but got text/html.

    Exception in thread "main" org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrExce ...

随机推荐

  1. JAVA方法传递参数:传值?传引用?

    先来看下面这三段代码: //Example1: public class Example1 { static void check(int a) { a++; } public static void ...

  2. 159. Find Minimum in Rotated Sorted Array 【medium】

    159. Find Minimum in Rotated Sorted Array [medium] Suppose a sorted array is rotated at some pivot u ...

  3. MAJOR-MINOR-MKDEV

    标记一下,容易忘,以免每次查代码. ./include/linux/types.h:21:typedef __u32 __kernel_dev_t; ./include/linux/types.h:2 ...

  4. Python模块学习之fabric

    fabric是一个运维经常使用到的一个模块.但是我在python3环境下安装fabric就遇到了坑! 安装包名称是fabric3而不是fabric! pip install fabric3 利用fab ...

  5. proxy_redirect参数的作用

    Nginx的代理功能太完善了,我们看看proxy_redirect参数的作用. 案例说明: 要做一个html.aslibra.com的域名处理很多网站的html内容,当然是后端的服务器了,目录分析 h ...

  6. Charles 的几个调试技巧

    Charles 是一个网络调试的代理工具,类似 Windows 下的 Fildder,这里介绍下几个常用的调试技巧,使用的版本是 Charles 4. 1.移动端抓包 在移动开发中,经常会遇到在手机上 ...

  7. ActionBar + ViewPager(PagerSlidingTabStrip)

    既然是要实现ActionBar.那么第一步当然就是编辑menu文件夹下的main.xml文件了.代码例如以下所看到的: <menu xmlns:android="http://sche ...

  8. 虚拟化笔记04.OpenFiler.install

    4.OpenFiler install OPENFILER 介绍 1.OpenFiler 作用 OpenFiler 基于Linux 内核,主要作用是实现IP-SAN. 在VSPHERE中我们可以将VM ...

  9. 【转】在Eclipse中使用JUnit4进行单元测试(高级篇)

    http://blog.csdn.net/andycpp/article/details/1329218 通过前2篇文章,您一定对JUnit有了一个基本的了解,下面我们来探讨一下JUnit4中一些高级 ...

  10. YII安装步骤(windows)

    一.首先你得下个YII框架的源码 :下载地址:http://www.yiiframework.com/download/ 二.把下载到的源码解压放到一个PHP可访问的位置:如我的 F:\site(已具 ...