Datasnap.DSService.TDSJSONService

From RAD Studio API Documentation
Jump to: navigation, search

Datasnap.DSService.TDSServiceDatasnap.DSService.TDSRequestFilterManagerSystem.TObjectTDSJSONService
[–] Properties
Type: class
Visibility: public
Source:
Datasnap.DSService.pas
Datasnap.DSService.hpp
Unit: Datasnap.DSService
Parent: Datasnap.DSService

Delphi

TDSJSONService = class(TDSService)

C++

class PASCALIMPLEMENTATION TDSJSONService : public TDSService

Description

Implements the service for the JSON HTTP request.

JSON HTTP requests are POST HTTP requests with JSON content, such as:

{
  [
    "execute": {
      "MethodClass.MethodName": [
        inputParameter1,
        inputParameter2
      ]
    }
  ],
  // …
}

TDSJSONService raises an exception if it cannot parse the JSON content.

TDSJSONService generates a result JSON property called "result" for each method, which contains a list with the values of the output and return parameters of the method execution. For example:

{
  "result": [ parameterValue1, parameterValue2, /* …, */ returnValue],
  "result": [ parameterValue1, parameterValue2, /* …, */ returnValue],
  // …
}

If a method raises an exception, the response contains an "error" property for that method instead of a "result" property. The "error" property contains the error message as value. For example:

"error": "Error message."

See Also