【发布时间】:2012-03-02 07:29:54
【问题描述】:
我需要使用 Adobe Air API 中的 HTTPService 类将数据字节数组作为 HTTP 正文发送。任何人都可以建议我这样做的方式吗?
【问题讨论】:
标签: apache-flex air flex4 flex3
我需要使用 Adobe Air API 中的 HTTPService 类将数据字节数组作为 HTTP 正文发送。任何人都可以建议我这样做的方式吗?
【问题讨论】:
标签: apache-flex air flex4 flex3
试试这个
var encodedString : String = Base64.encode( imageByteArray );
var service : HTTPService = new HTTPService();
service.method = "POST";
service.contentType = 'application/x-www-form-urlencoded';
service.url = 'http://www.mydomain.com/upload.php';
var variables : URLVariables = new URLVariables();
variables.imageArray = encodedString;
variables.variable2 = "some text string";
variables.variable3 = "some more text";
service.send( variables );
Base64 类获取自
http://code.google.com/p/jpauclair-blog/source/browse/trunk/Experiment/Base64/src/Base64.as
【讨论】: