dimanche 24 juin 2018

how to store json to database in rails

have URl want to store json data to database automatically

site provide this code but use Java

HttpResponse response = Unirest.get("https://xproject.restdb.io/rest/data")
  .header("x-apikey", "42ba8a6dc7532aa8319a58310281665e394e4")
  .header("cache-control", "no-cache")
  .asString(); 

This Example of json

enter image description here

model called speed contain speed & id
need save gps_speed_kph = speed & id_watch ==_id

Aucun commentaire:

Enregistrer un commentaire