Page 1 of 1

passing a float to a rest api call

Posted: Tue May 14, 2013 7:41 pm
by Jeremy5835883

I want to test a rest service call that requires a float as one of the inputs. It seems it is always being sent as a string. how can i specify the type of that data to be sent. below is what the request should look like..

"data":
{
"LatLon":{
"__type":"GeoPoint",
"latitude":40.934784,
"longitude":-73.12912
}
}


passing a float to a rest api call

Posted: Tue May 14, 2013 7:48 pm
by maxkatz

On page mapping for the service, run this:
code
return number;
/code


passing a float to a rest api call

Posted: Tue May 14, 2013 7:50 pm
by Jeremy5835883

I am trying to run this using the test functionality in the view for the service. Where would I put the "return number" statement?


passing a float to a rest api call

Posted: Tue May 14, 2013 7:51 pm
by maxkatz

Won't work from Test view yet.. need to run from page.


passing a float to a rest api call

Posted: Tue May 14, 2013 7:52 pm
by Jeremy5835883

thanks but where would i run that statement on the mapping page? a screenshot perhaps?


passing a float to a rest api call

Posted: Tue May 14, 2013 7:59 pm
by maxkatz

passing a float to a rest api call

Posted: Tue May 14, 2013 8:01 pm
by Jeremy5835883

thanks