Create REST client resource pragmatically
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 pm
Create REST client resource pragmatically
Is there way to create and execute a REST resource pragmatically without creating a REST resource to back it up ?
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Yes using the services.rest API, see http://www.ebasetech.com/ebase/doc/Rest ... amming.htm.
Here's an example:
Here's an example:
Code: Select all
var headers = {
"timezone" : "xxx"
};
var uri = "http://xxx.com/api/controllerApi/getTimeZone";
try
{
var response = services.rest.get(uri, headers, null);
if(response.isSuccess());
{
// Parse the JSON response object
var tz = JSON.parse(response.getBody());
}
else
{
...handle errors
}
}
catch (e)
{
.. an I/O Error can be thrown in some circumstances
}
0 x
Who is online
Users browsing this forum: No registered users and 11 guests