关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
来源:互联网 发布:播放软件大全排行 编辑:程序博客网 时间:2024/06/01 08:12
最近项目中用到的一个是用一个页面接收c程序post过来的一断字符串..总接收不到值...
我用C#写一个测试可以正常接收到值.
最后抓包比较
区别只是
Content-Type:application/x-www-form-urlencoded
和
Content-Type:multipart/related
查资料得:
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)。
转载:http://www.cnblogs.com/taoys/archive/2010/12/30/1922186.html
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/rel (2
- Content-Type的application/x-www-form-urlencoded和multipart/related
- Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/rel
- Content-Type:application/x-www-form-urlencoded 和 multipart/form-data
- Content-Type: application/x-www-form-urlencoded
- 关于Content-Type中application/x-www-form-urlencoded 和 multipart/form-data的区别及用法
- 关于 Content-Type:application/x-www-form-urlencoded
- [转]Content-Type: application/x-www-form-urlencoded
- Content-Type: application/x-www-form-urlencoded什么意思
- Form content types(表单内容类型)--application/x-www-form-urlencoded和multipart/form-data
- android导入项目时的错误整理
- 基于ARM9程序状态寄存器CPSR
- 2646 线段树练习题三
- [bash]判断当前用户是否为root
- 数据压缩三-Huffman编码与解码
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- 有关JavaScript中的节点类型
- POJ 3692 Kindergarten(二分图)
- 51nod 瞬间移动 (组合数学)
- PickerView3D滚轮控件
- 万事起于忽微,量变引起质变
- OSGI企业应用开发(十)整合Spring和Mybatis框架(三)
- Objective-C开发编码规范
- 一篇很全面的freemarker教程