关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
来源:互联网 发布:如何创建淘宝优站 编辑:程序博客网 时间:2024/06/05 23:21
原帖地址:
关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related - 无法更新的~ - 博客园
http://www.cnblogs.com/taoys/archive/2010/12/30/1922186.html
最近项目中用到的一个是用一个页面接收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)。
- 关于 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
- php---utf-8文件下生成csv文件
- 使用HttpURLConnection实现在android客户端和服务器之间传递对象
- 搭建中级注册码(网络验证码)系统教程
- 克鲁斯卡尔(Kruskal)算法求最小生成树
- jQuery中添加自定义或函数方法
- 关于 Content-Type:application/x-www-form-urlencoded 和 Content-Type:multipart/related
- C语言练习作业(三)
- Ajax+ashx+json三层架构无刷新分页、删除、修改、查看
- 三菱PLCFX3U控制步进电机联动
- postgres 项目中使用问题记录
- org.http.HttpResponse cannot be resolved 错误
- whireshark工具使用和tcp报文学习心得
- MongoDB(二)
- UIView的层次结构--code