create
create(resource: String);
The create method of the JadeRestRequest class instantiates an object of the JadeRestRequest class. It requires a resource as a parameter. The specified resource, which includes the name of the resource and any parameters required by the operation, is of the following format.
resourceName/{param1}/{param2}/
These parameters should then be set to the required values using the addURLSeg method.
The following is an example of the create method.
getComic(): Comic;
vars
client : JadeRestClient;
request : JadeRestRequest;
response : JadeRestResponse;
comics : ObjectArray;
begin
request := create JadeRestRequest("info.{comic}.json");
request.addURLSeg("comic", "0");
client := create JadeRestClient("https://xkcd.com/");
response := create JadeRestResponse();
client.get(request, response);
comics := create ObjectArray() transient;
response.deserialize(Comic, comics);
if comics.size > 0 then
return comics[1].Comic;
else
return null;
endif;
epilog
delete client;
delete request;
delete response;
delete comics;
end;
2020.0.01 and higher
