asynchttp 和 rhomobile

发布于 2024-09-28 06:50:04 字数 58 浏览 0 评论 0原文

如何在 rhomobile 应用程序中显示 JSON 数据而不将其保存到数据库?

谢谢

How can i display JSON data in a rhomobile application without saving it to a database?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不弃不离 2024-10-05 06:50:04

使用
异步Http

def index
   Rho::AsyncHttp.get(
            :url => "http://someurlx.com",
            :callback  => :parse)
end

def parse
    body= @params['body']
    @@json_data = Rho::JSON.parse(body)

end

use
AsyncHttp

def index
   Rho::AsyncHttp.get(
            :url => "http://someurlx.com",
            :callback  => :parse)
end

def parse
    body= @params['body']
    @@json_data = Rho::JSON.parse(body)

end
滴情不沾 2024-10-05 06:50:04

要显示 JSON 数据,最好的方法是我在此处找到的

To display JSON data the best method is what I found here

半仙 2024-10-05 06:50:04

尝试这个来获取没有回调 url 的 json

@response=Rho::AsyncHttp.get(
            :url => "http://rhostore.herokuapp.com/customers.json"     
      )
json_parse=JSON.parse(@response)

Try this one to get json without callback url

@response=Rho::AsyncHttp.get(
            :url => "http://rhostore.herokuapp.com/customers.json"     
      )
json_parse=JSON.parse(@response)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文