REST.Backend.EMSApi.TEMSClientAPI.QueryResource
Delphi
procedure QueryResource(const AResource: string; const AQuery: array of string; const AJSONArray: TJSONArray; AReset: Boolean; const AAddParameters: TProc = nil);
C++
void __fastcall QueryResource(const System::UnicodeString AResource, System::UnicodeString const *AQuery, const int AQuery_High, System::Json::TJSONArray* const AJSONArray, bool AReset, const System::Sysutils::_di_TProc AAddParameters = System::Sysutils::_di_TProc());
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
procedure function |
protected | REST.Backend.EMSApi.pas REST.Backend.EMSApi.hpp |
REST.Backend.EMSApi | TEMSClientAPI |
Description
Queries the EMS server for a list of resources of the specified resource type.
QueryResource receives the following parameters:
AResourceis the target type of resource.AQueryis an array of strings where each string must contain a key-value pair separated by an equal sign, such as "my_parameter=my_value". QueryResource adds those key-value pairs to the request as parameters.- QueryResource fills
AJSONArraywith the results from the EMS server. AResetdetermines whether QueryResource should reset the request parameters (True) or build your new request on top of the parameters of your previous request (False).For example, if you are going to perform several queries in a row that contain the same parameters and simply target a different resource, you can pass
FalseasAResetfor a better performance.AAddParameters(optional) is a procedure without parameters that you can use to update the request. For example, you can add parameters to the request.
Exceptions
| Exception | Message | Description |
|---|---|---|
|
MasterSecret required |
Authentication is TAuthentication.MasterSecret and ConnectionInfo.MasterSecret is an empty string. | |
|
Session token required |
Authentication is TAuthentication.Session and you did not log in or the session authentication token that you provided to Login is an empty string. |