json - Postman sending raw data -


im trying send raw data web service have. service waiting object named viaje has next data: * iddestino numeric id * idlanta numeric id * idpeticion array of numeric ids * idvehiculo numeric id

heres im trying out, wont detect index viaje.

{   "viaje" :      [{       "iddestino" : 7,       "idllanta" : 7,       "idpeticiones" : [{2,12]],       "idvehiculo" : 1,     }] } 

im using laravel web services , here how im reciving data.

$object = input::all();   $object = $object["viaje"];  //variables de login inputs $iddestino = $object['iddestino']; $fechainicio = date('y-m-d h:i:s'); $idllanta = $object['idllanta']; $idpeticiones = $object['idpeticiones']; $idvehiculo = $object['idvehiculo']; 

what want know how structure raw data im sending fit description gave. if doing in form-data possible how this?

ok found out how format json array:

{    "viaje" : {      "idpeticiones": [        "1",       "12"      ],      "idllanta": 4,     "iddestino": 7,      "idvehiculo": 1   } }  

i using {} object instead of {} array


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -