-1

我有一个 XML 文件,我想将它发送到 rails 服务器。为此,我使用以下代码:

 <mx:HTTPService id="dataService"
 result="resultHandler(event)"
 resultFormat="e4x"/>

在保存按钮触发的功能中,我执行以下操作:

 var params:Object = {};
 params["xml_file"] = xmlDoc;
 dataService.method = "POST";
 dataService.url = "http://localhost:3000/containers";
 dataService.send(params);

不幸的是,总会出现问题(见下文)。如果我删除 params var,它会运行一个 GET 请求...

[RPC 故障 faultString="HTTP 请求错误" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream-Fehler . 网址:http://localhost:3000/containers "]。网址:http://localhost:3000/containers "]

可能是什么问题呢?

感谢您的任何提示!马库斯

4

1 回答 1

0

您的弹性代码正在调用容器控制器(/容器)的索引操作,但是,当您不发送任何参数时,Rails 会将其视为获取操作,请检查您的 development.log 文件以获取有关错误的更多描述。

于 2010-05-19T15:04:03.950 回答