Application service module that helps build responses using various JSON formats.
Syntax
Response = HTTP_JSON_Services(@Service, @Params)
Returns
The meaning of the response value depends on the service.
Parameters
Parameter | Description |
---|---|
@Service | The name of the service being requested. Required. |
@Params | Generic parameters. Refer to a specific service to determine the actual parameters used. |
Remarks
The SRP HTTP Framework supports two popular JSON friendly data formats: HAL and Schema. HAL stands for Hypermedia Application Language and is an emerging format that implements the HATEOAS constraint of REST. There are other formats that are also emerging and none hold dominance at this point. Likewise, JSON itself stands alongside XML as a widely accepted general purpose format for representing resources. Therefore, if you need or prefer to use another format then you are welcome to extend HTTP_JSON_Services
(in case you want to use a different hypermedia format, such as Collection) or write a new service such as HTTP_XML_Services
(in case you want to use a different data format, such as XML).
Schema is a meta-data format. It is used to notify clients what kind of data is available, which is handy when user interfaces need to be dynamically built. Schema can be used to define if a prompt is text, numeric, date, combobox, Boolean, etc. Like HAL, Schema is also an emerging format. There are others that may be better suited to your needs.
Services
Service | Description |
---|---|
SetHALItem | Usage: Comments: Returns: |
SetHALCollection | Usage: Comments: Returns: |
SetHALCollectionEmbedded | Usage: Comments: Returns: |
SetHALLinks | Usage: Comments: Returns: |
GetHAL | Usage: Comments: Returns: |
GetSchemaRootObj | Usage: Comments: Returns: |
SetSchemaMeta | Usage: Comments: Returns: |
SetSchemaProperty | Usage: Comments: Returns: |
GetSchema | Usage: Comments: Returns: |
GetURLFromID | Usage: Comments: Returns: |
GetIDFromURL | Usage: Comments: Returns: |
Params
The proper use of the generic arguments are defined in the definition of each service above.