Rhomobile 罗兹 Rho AsyncHttp 帖子
我在使用 Rhomobile rhodes 时遇到问题,请有人告诉我如何使用 Rho::AsyncHttp 进行 http post、获取、放置和删除? 我已经尝试了几个小时但没有成功。
I am having problems with Rhomobile rhodes, plaese can someone tell me how to make http post, get, put, and delete using Rho::AsyncHttp?
I've been trying it to no success for hours.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一些要放置在controller.rb文件中的示例代码
这是初始调用
结束
上面的代码将启动httpget_callback方法(如下)
当它关闭并加载 url 时,它将更改屏幕并加载 wait.erb 文件
end
无需深入了解 - 返回页面的正文被放入 @html 变量中
希望有帮助,如果您需要更多帮助,请告诉我。
Here's some sample code to place in your controller.rb file
Here's the initial call
end
the code above will initiate the httpget_callback method (below)
while that goes off and loads the url it'll change the screen and load the wait.erb file
end
Without getting too far into it - the body of the returned page is placed into @html variable
Hope that helps, if you need more help, let me know.
我有一个获取帖子的样本
res = Rho::AsyncHttp.post(:url => 'http://192.168.1.64 /WebServiceTest/Service.asmx/Sumar')
@msg=“同步http调用:#{res}”
http://wiki.rhomobile.com /index.php/RhodesConnectToWebServices
I have a sample of get an post
res = Rho::AsyncHttp.post(:url => 'http://192.168.1.64/WebServiceTest/Service.asmx/Sumar')
@msg= "Sync http call: #{res}"
http://wiki.rhomobile.com/index.php/RhodesConnectToWebServices
我也经常在罗德岛中与 AsyncHttp 的细微差别作斗争,所以我还不能声称掌握了,但我真的觉得有必要提出一个建议:
我发现使用 Firefox 的 Firebug 插件在以下情况下非常有帮助:调试我的 Rhodes 应用程序。您可以非常轻松地将其连接起来!您可以通过将 Web 服务器配置为在特定端口上运行来使用任何浏览器加载您的应用程序。此设置位于
rhoconfig.txt
中,称为local_server_port
。这特别有用,因为您可以轻松地调查请求/响应的 HTML 和原始数据,并使用控制台运行 javascript 命令并实时使用 DOM 和网页。
I'm often struggling with the nuances of AsyncHttp in Rhodes as well, so I can't claim mastery yet, but I really felt the need to chime in with a suggestion:
I find using the Firebug plugin of Firefox to be VERY helpful when debugging my Rhodes app. You can hook it up very easily! You can load your app with any browser by configuring the web server to run on a specific port. This setting is in
rhoconfig.txt
and it is calledlocal_server_port
.This is specifically helpful because you can easily survey the HTML and raw data of requests/responses and use the console to run javascript commands and play with the DOM and web page in realtime.