Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Response = HTTP_JSON_Services(Service, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10@Service, @Params)

Returns

The meaning of the response value depends on the service.

Parameters

ParameterDescription
Service@ServiceThe name of the service being requested. Required.
Param1 - Param10@ParamsGeneric 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).

...

ServiceDescription
SetHALItem

Usage:
HTTP_JSON_Services('SetHALItem', ItemURL, ColumnNames, ColumnValues, DataTypes)

Comments:
Creates a HAL+JSON object for a specific item. Requires the GetHAL service to return the serialized object.

Returns:
N/A

SetHALCollection

Usage:
HTTP_JSON_Services('SetHALCollection', ItemURLCollectionURL, ColumnNamesItemsURLs, ColumnValues, DataTypesItemsTitles)

Comments:
Creates a HAL+JSON object for a specific itemcollection. Requires the GetHAL service to return the serialized object.

Returns:
N/A

SetHALCollectionEmbedded

Usage:
HTTP_JSON_Services('SetHALCollectionEmbedded', CollectionURL, ItemURLItemsURLs, ColumnNames, ColumnValues, DataTypes)

Comments:
Creates a HAL+JSON object for a specific itemcollection of embedded items. Requires the GetHAL service to return the serialized object.

Returns:
N/A

SetHALLinks

Usage:
HTTP_JSON_Services('SetHALLinks', ItemURL, ColumnNames, ColumnValues, DataTypesSelfURI, HREFNames, HREFURIs, ChildNames, hChildren, Names, Values)

Comments:
Creates a HAL +JSON object for a specific item. Requires the GetHAL service to return the serialized object.style "links" object.

Returns:
N/A

GetHAL

Usage:
HTTP_JSON_Services('GetHAL', ItemURL, ColumnNames, ColumnValues, DataTypesItemArrayLabel)

Comments:
Creates a HAL+Returns the serialized JSON object for a specific item. Requires the GetHAL service to return the serialized objectthe current HAL response. If no HAL object has been defined then this will return an empty string and a 500 status code will be set. All HAL objects and arrays will be released in this service.

Returns:
N/AA serialized HAL+JSON object based based on the current HAL objects in memory.

GetSchemaRootObj

Usage:
HTTP_JSON_Services('GetSchemaRootObj', ItemURL, ColumnNames, ColumnValues, DataTypes)

Comments:
Creates a HAL+JSON object for a specific item. Requires the GetHAL service to return the serialized objectReturns the handle to a root Schema object. If it does not already exist it will be created with the standard "$schema" value already added.

Returns:
N/AHandle to a root Schema+JSON object.

SetSchemaMeta

Usage:
HTTP_JSON_Services('SetSchemaMeta', ItemURLTitle, ColumnNamesDescription, ColumnValues, DataTypesType)

Comments:
Creates a HAL+JSON object for a specific item. Requires the GetHAL service to return the serialized Sets the meta data associated to the schema object.

Returns:
N/A

SetSchemaProperty

Usage:
HTTP_JSON_Services('SetSchemaProperty', Name, Title, ItemURLType, ColumnNamesFormat, ColumnValuesEnumList, DataTypesRequired)

Comments:
Creates a HAL+JSON object for a specific item. Requires the GetHAL service to return the serialized objectSets a property to the schema. There can be more than one property so this service will add another property to the list if it already exists.

Returns:
N/A

GetSchema

Usage:
HTTP_JSON_Services('GetSchema', ItemURL, ColumnNames, ColumnValues, DataTypes)

Comments:
Creates a HAL+Returns the serialized JSON object for a specific item. Requires the GetHAL service to return the serialized objectthe current schema. If no schema object has been defined then this will return an empty string and a 500 status code will be set. All schema objects and arrays will be released in this service.

Returns:
N/AA serialized Schema+JSON object based based on the current Schema objects in memory.

GetURLFromID

Usage:
HTTP_JSON_Services('GetURLFromID', ItemURL, ColumnNames, ColumnValues, DataTypesID)

Comments:
Creates a HAL+JSON object for a specific item. Requires the GetHAL service to return the serialized objectReturns a URL segment for the ID passed into the service. This creates a "slug" style URL so that it will be search friendly, human readable, and an RESTful.

Returns:
N/AA "slug" style URL segment for a given resource ID.

GetIDFromURL

Usage:
HTTP_JSON_Services('GetIDFromURL', ItemURL, ColumnNames, ColumnValues, DataTypes URL, Array)

Comments:
Creates a HAL+JSON object for a specific item. Requires the GetHAL service to return the serialized objectReturns the ID based on the URL passed into the service. This service attempts to reverse engineer the URL.

Returns:
N/A

...

A resource (item) ID.

Params

The proper use of the generic arguments are defined in the definition of each service above.