Flex:在正文中发送带有二进制数据的 HTTP POST 请求 [英] Flex: Send HTTP POST request with binary data in body

查看:28
本文介绍了Flex:在正文中发送带有二进制数据的 HTTP POST 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Flex 的新手,还不知道如何将二进制数据作为 POST 请求的正文发送到服务器.HTTPService 组件似乎不支持这一点.FileReference 似乎不支持通过 Flex API 设置数据.

I'm new to Flex and couldn't figure out yet how to send binary data to the server as the body of a POST request. The HTTPService component doesn't seem to support this. The FileReference doesn't seem to support setting the data via the Flex API.

不幸的是,stackoverflow.com 上类似问题的答案并不是很有希望.任何新的指针将不胜感激,非常感谢!

Unfortunately the answers to similar questions on stackoverflow.com haven't been very promising. Any new pointers would be greatly appreciated, thanks a lot!

-- 安德烈亚斯

推荐答案

使用 URLLoaderURLRequest 类发布.

Post it using the URLLoader and URLRequest classes.

var urlLoader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(url);
request.data = binaryData;
request.method = URLRequestMethod.POST
urlLoader.load(request);

这篇关于Flex:在正文中发送带有二进制数据的 HTTP POST 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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