create

create(endpoint: String);

The create method of the JadeRestClient class creates the JadeRestClient object, as shown in the following example.

postPet(pet : Pet);
vars
    client   : JadeRestClient;
    request  : JadeRestRequest;
    response : JadeRestResponse;
begin
    client := create JadeRestClient("https://petstore.swagger.io/v2");
    request := create JadeRestRequest("pet");
    request.dataFormat := request.DataFormat_JSON;
    request.addObjectParam(pet, Pet);
    response := create JadeRestResponse();
    client.post(request, response);
epilog
    delete client;
    delete request;
    delete response;
end;

When you create an instance of the JadeRestClient class, you need to pass an endpoint parameter. (For details, see about specifying the creation of transient objects that can be shared across threads, see "create Instruction", in Chapter 1 of the JADE Developer’s Reference.) The endpoint parameter represents the location of the REST API and is used as the first part of the Uniform Resource Locator (URI); that is, the part of the URI that precedes the resource name.

2020.0.01 and higher