1 Reply Latest reply on Nov 25, 2013 4:21 AM by Kutir Mobility

    How to send params to body of Async http post

      Hi,

       

      I am able to get data with Asynchttp.get method. But while using Asynchttp.post to send params through body am not able to post data to server. If any one has code snippet please share it.

        • Re: How to send params to body of Async http post
          Kutir Mobility

          Hi Rani,

          Try as shown below,

              name = @params['developer']['name']

              role = @params['developer']['role']

              body = '{"developer" : {"name" : "'+ name +'","role" :"'+ role +'"  } }'

              @result =  Rho::AsyncHttp.post(:url => "Your Server Url Here",

              :body => body, :http_command => "POST", :headers => {"Content-Type" => "application/json"}) 

           

          VP

          Kutir Mobility