Ruby send Json response to http post call -
i have ruby code takes http post client. makes http post, , want send json response based on response post. how do this? trying use answer post: how send simple json response in rails? but giving me errors when try compile. require 'sinatra' require 'rest-client' require 'sequel' require 'pg' require 'json/ext' require 'net/http' require 'json' require 'monza' require 'time' post '/receiptvalidation' # find devices corresponding reg_tokens base64receiptdatastring = params[:base64receiptdatastring] uri = uri("https://sandbox.itunes.apple.com") net::http.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') |http| response = http.post('/verifyreceipt', params_json) parsedjson = json.parse(response.body) # ***** send json response here ******* respond_to |format| # ... other formats here ... format.jsonr...