我想使用Adobe Flex发布一些JSON数据,但有一些问题。我现在收到错误消息“必须使用useProxy将URL指定为false”,尽管我的useProxy设置为false。如何使用Adobe Flex发布JSON
更新:下面的代码现在正在工作。
var data:Object = new Object(); data.ipaddr = ipaddr.text; data.netmask = netmask.text; data.gatewayip = gatewayip.text; var jsonData:String = JSON.stringify(data); var s:mx.rpc.http.HTTPService = new mx.rpc.http.HTTPService(); // URL needs to be specified on a separate line, call is unreliable otherwise s.url = Utils.getBaseURL() + '/cgi-bin/setnetworksettings'; s.contentType = "application/json"; s.resultFormat = mx.rpc.http.HTTPService.RESULT_FORMAT_TEXT; s.method = "POST"; s.useProxy = false; s.addEventListener("result", httpResult); s.addEventListener("fault", httpFault); s.send(jsonData);
我没有经验ňAdobe Flex的,但我希望这urrl可以帮助你,http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json- with-flex-2-and-actionscript-3/ – viyancs 2012-03-19 02:54:20
s.send(JSON.encode(.. yourObject ..)); – 2012-03-19 03:40:27