包含多个文件的 Multipart HTTP 请求应该是什么样的?

编程入门 行业动态 更新时间:2024-10-22 15:38:59
本文介绍了包含多个文件的 Multipart HTTP 请求应该是什么样的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发一个 iPhone 应用程序,该应用程序使用多个图像文件发出多部分 HTTP 请求.

I'm working on an iPhone app that makes a multipart HTTP request with multiple image files.

看起来在服务器端发生的事情是其中一个图像被正确解析,但其他两个文件没有.

It looks like what's happening, on the server side, is that one of the images is getting parsed properly, but the other two files are not.

有人可以发布包含多个图像文件的示例 HTTP 多部分请求吗?

Can anybody post a sample HTTP multipart request that contains multiple image files?

推荐答案

好吧,请注意请求包含二进制数据,所以我不会发布请求 - 相反,我已经转换了每个不可打印的 ascii字符变成一个点(.").

Well, note that the request contains binary data, so I'm not posting the request as such - instead, I've converted every non-printable-ascii character into a dot (".").

POST /cgi-bin/qtest HTTP/1.1 Host: aram User-Agent: Mozilla/5.0 Gecko/2009042316 Firefox/3.0.10 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: aram/~martind/banner.htm Content-Type: multipart/form-data; boundary=2a8ae6ad-f4ad-4d9a-a92c-6d217011fe0f Content-Length: 514 --2a8ae6ad-f4ad-4d9a-a92c-6d217011fe0f Content-Disposition: form-data; name="datafile1"; filename="r.gif" Content-Type: image/gif GIF87a.............,...........D..; --2a8ae6ad-f4ad-4d9a-a92c-6d217011fe0f Content-Disposition: form-data; name="datafile2"; filename="g.gif" Content-Type: image/gif GIF87a.............,...........D..; --2a8ae6ad-f4ad-4d9a-a92c-6d217011fe0f Content-Disposition: form-data; name="datafile3"; filename="b.gif" Content-Type: image/gif GIF87a.............,...........D..; --2a8ae6ad-f4ad-4d9a-a92c-6d217011fe0f--

请注意,每一行(包括最后一行)都以 序列终止.

Note that every line (including the last one) is terminated by a sequence.

更多推荐

包含多个文件的 Multipart HTTP 请求应该是什么样的?

本文发布于:2023-11-01 17:59:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550017.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   应该是   文件   Multipart   HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!