company logo

HTTP requests

HTTP Requests may be send to OHTTPServer as GET, PUT, PATCH, DELETE, POST or OSI (POST) requests. For retrieving data from the database the GET request is used. Special update requests are supported by PUT,POST and PATCH request type. Deletion of database instances becomes possible by means of DELETE requests. Extended features are provided by the OSI POST request. Requests have the following common format:

http://server:port/location[?parameter]

[body]

location - Data to be accessed or updated. The syntax of location is described in detail in Symbol Reference / location - HTTP URL.

parameter - Several request types support parameters, which are well-defined keywords for controlling the behavior of the request. Supported parameters depend on request type.

body - For all HTTP requests except GET and DELETE, data may be passed in a body, which is, usually, interpreted as update data. Update data contains data for properties in location to be updated.

The body passed to the request may contain data for one or more properties (data items) in a JSON string as values.

values may be a single elementary value (number or string), but also a complex object or array (collection). Details for values are described in Symbol reference / Values, formats and encoding.

In case of collection source property, body data may be used also for locating an instance. When a collection URL has been passed in location, the server tries to locate an instance in the collection via values for key component properties passed in body (POST). This allows accessing instances with multiple key components.

The response to any request is a JSON string (values - UTF8 encoded), which contains either response data or an error message (see Symbol reference / Request result (response) ).

Related topics