如何发送“多部分/相关"Actionscript 中的内容类型? [英] How to send a "multipart/related" content type in Actionscript?

查看:29
本文介绍了如何发送“多部分/相关"Actionscript 中的内容类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想通过 http Post 在 actionscript 中发送以下格式正文:

If I want to send the following format body in actionscript through http Post:

Content-Type: multipart/related; boundary="END_OF_PART"
Content-Length: 423478347
MIME-version: 1.0

Media multipart posting
--END_OF_PART
Content-Type: application/atom+xml

<entry xmlns='http://www.w3.org/2005/Atom'>
  <title>plz-to-love-realcat.jpg</title>
  <summary>Real cat wants attention too.</summary>
  <category scheme="http://schemas.google.com/g/2005#kind"
    term="http://schemas.google.com/photos/2007#photo"/>
</entry>
--END_OF_PART
Content-Type: image/jpeg

...binary image data...
--END_OF_PART--

如何编写动作脚本以发送多部分/相关"内容类型.
请指教.谢谢.

How can I write the actionscript to send the "multipart/related" content type.
Please advice. Thanks.

推荐答案

使用 AS3 HTTPClient 库之类的东西可能会有帮助 - 它们具有用于普通 AS3 不会的各种请求/响应标头操作的辅助方法做.您可以在这里找到它:http://code.google.com/p/as3httpclientlib/

One thing that might help is using something like the AS3 HTTPClient library - they have helper methods for all sorts of request/response header manipulation that plain AS3 won't do. You can find it here: http://code.google.com/p/as3httpclientlib/

除了简单的 HTTP get/post 之外的任何事情在 Flash 中总是很痛苦,而多部分 POST 特别棘手.如果那个 httpclient 没有做你需要做的事情,请告诉我,我还有一个过去用来做这件事的实用程序.如果您需要,我可以为您挖掘,请告诉我!

Doing anything beyond simple HTTP get/post is always a pain in Flash, and multipart POST is particularly tricky. If that httpclient doesn't do what you need let me know and I have one more utility I used to do this in the past. I can dig that up for you if you need it, just let me know!

希望有所帮助,我的

这篇关于如何发送“多部分/相关"Actionscript 中的内容类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆