Http Protocol data transmission in a multiple form submission--multipart/form-data
来源:互联网 发布:战舰世界舰船数据 编辑:程序博客网 时间:2024/06/06 08:48
http://www.cnblogs.com/shanyou/archive/2013/06/07/3123155.html
RFC 2188:Returning Values from Forms:multipart/form-data, this document explains the practice of using HTTP POST message information in multiple formats, it can be used in many REST-based API system, it can mix a variety of data formats and transmission at a time, of course, non-text data must be encoded as a binary string.
RFC 2387 files, pointed out that to transport multiple parameters, multiple information types mixed information, first set the HTTP request Content-Type to multipart/form-data, and to set a boundary parameter, this parameter is generated by the application itself, it is used to identify every boundaries of information (boundary) for manifold information (message part), andHTTP POST HTTP server can crawl information and adopt a familiar object model exposed to server reads (ex:ASP.NET Request.Form).
Below is a multipart/form-data of multiple parameters of messages (source:RFC 2388):
Content-Type: multipart/form-data; boundary=MYBOUNDARY
…
--MYBOUNDARY
Content-Disposition: form-data; name="[PARAMETER-NAME]"
<NEWLINE>
<NEWLINE>
<Data goes here>
--MYBOUNDARY
Content-Disposition: form-data; name="[PARAMETER-NAME]"
<NEWLINE>
<NEWLINE>
<Data goes here>
--MYBOUNDARY
Content-Disposition: form-data; name="[PARAMETER-NAME]"
Content-Type: image/jpeg
<NEWLINE>
<NEWLINE>
<Image data goes here>
--MYBOUNDARY
Above seem pretty hard to understand, but the basic concepts are:
1. each information--[BOUNDARY_NAME] wrap to separate each part of the information, and finally add another--[BOUNDARY_NAME] to indicate the end.
2. each part have a Content-Disposition:form-data of information;Name = "", and the key value name is set by HTTP POST (key).
3. declarations and values across two new line symbols (. NET, Environment.NewLine is).
4. can clip into binary data, but binary data must be formatted as a binary string, this work will be used by HttpWebRequest NetworkStream.Write () write upload information is automatically removed by the system.
5. to set a different piece of information data type (Content-Type), the declared area set in the information.
- Http Protocol data transmission in a multiple form submission--multipart/form-data
- HTTP multipart/form-data 上传方式说明
- Http 上传文件之multipart form-data
- Http 协议 post multipart/form-data
- HTTP multipart/form-data 请求协议分析
- HTTP协议之multipart/form-data请求
- 关于multipart/form-data
- multipart/form-data
- multipart/form-data
- multipart/form-data
- Multipart/form-data POST
- apiary multipart/form-data
- multipart/form-data
- multipart/form-data
- enctype="multipart/form-data"
- enctype="multipart/form-data"
- multipart form-data boundary 说明
- ENCTYPE="multipart/form-data"
- C中malloc的使用(转)
- Jeff Darcy个人发布的分布式存储测试分析报告为什么只关注Small Synchronous Writes
- CSS清除浮动大全,共8种方法
- LeetCode 136 — Single Number(C++ Java Python)
- 异步编程:线程概述及使用
- Http Protocol data transmission in a multiple form submission--multipart/form-data
- Android 泰语、缅甸语等复杂语言圈圈问题
- 一、javascript简介
- opencv中cvFindContours函数两个测试程序
- tq210 内存配置
- Android 菜单(OptionMenu)大全 建立你自己的菜单
- 2014资料整理--NSArray用法(三)
- 《网上订餐系统》开发全程回忆
- C#导出Excel的示例