6 Replies Latest reply on Apr 18, 2014 1:21 PM by Araz Rahimi

    Get back HTTP get data

    Araz Rahimi

      Hello everyone,  I'm new to Rhomobile and Ruby and I'm just playing around with the framework right now. I'm trying to do a HTTP get to a WCF rest service, and show the data on a result view. Right now I've got this:

       

      def test_http_post        

        getProps = Hash.new        

        getProps['url'] = "http://localhost/RestServiceImpl.svc/GetId"           getProps['headers'] = {"Content-Type" => "application/json"}         

        response = Rho::Network.get(getProps, url_for(:action => :get_callback))           @msg = "Loading..."               

        render :action => :wait 

      end    

       

      def get_callback   

        if @params['status'] == "ok"     

        get_result = Rho::JSON.parse(@params['body'])               WebView.navigate( url_for(:action => :result))   

        end  

      end

       

      I'm getting a response from the WCF and the WebView.navite works well, but I can't seem to view the data on the "result" view. How do I pass the data in "get_result" there?   Thanks!  Best Regards  Araz