SewioRestClient::SewioRestClient Class Reference

this class provides the REST client API for communication with Sewio.net's RTLS Studio servers More...

Inheritance diagram for SewioRestClient::SewioRestClient:
[legend]

## Public Attributes

const | DefaultSendEncoding = "gzip"
| default send encoding
const | RequiredOptions
| required options

## Private Member Functions

| constructor (hash opts, *softbool do_not_connect)
| creates the object with the given options (which include the mandatory `apikey` option for Sewio.net's RTLS Studio server authentication) More...

## Static Private Member Functions

static hash | getOptions (hash opts)
| returns options for the RestClient::constructor()

## Detailed Description

this class provides the REST client API for communication with Sewio.net's RTLS Studio servers

This class requires the following options for Sewio.net's RTLS Studio authentication and authorization to the target server:

- `apikey:` the Sewio.net's RTLS Studio API key

## Member Function Documentation

## constructor()

SewioRestClient::SewioRestClient::constructor | ( | hash | opts,
|  | *softbool | do_not_connect
| ) |  |

private

creates the object with the given options (which include the mandatory `apikey` option for Sewio.net's RTLS Studio server authentication)

Example:
  SewioRestClient rest(("url": "http://rtlsstudio.com/sensmapserver", "apikey": apikey));

Parameters

  opts

  valid options are:
  - `additional_methods:` Optional hash with more but not-HTTP-standardized methods to handle. It allows to create various HTTP extensions like e.g. WebDAV. The hash takes the method name as a key, and the value is a boolean True or False: indicating if the method requires a message body as well. Example:
    # add new HTTP methods for WebDAV. Both of them require body posting to the server
    ("additional_methods": ("PROPFIND": True, "MKCOL": True ));
  - `apikey:` (required) the Sewio.net's RTLS Studio api key for the target server
  - `content_encoding:` for possible values, see EncodingSupport; this sets the send encoding (if the `"send_encoding"` option is not set) and the requested response encoding (note that the RestClient class will only compress outgoing message bodies over CompressionThreshold bytes in size)
  - `data:` a data serialization option; if not present defaults to `"json"`
  - `default_path:` The default path to use for new connections if a path is not otherwise specified in the connection URL
  - `default_port:` The default port number to connect to if none is given in the URL
  - `headers:` an optional hash of headers to send with every request, these can also be overridden in request method calls
  - `http_version:` Either '1.0' or '1.1' (default) for the claimed HTTP protocol version compliancy in outgoing message headers
  - `max_redirects:` The maximum number of redirects before throwing an exception (the default is 5)
  - `proxy:` The proxy URL for connecting through a proxy
  - `send_encoding:` a send data encoding option or the value `"auto"` which means to use automatic encoding; if not present defaults to `"gzip"` content encoding on sent message bodies (note that the RestClient class will only compress outgoing message bodies over CompressionThreshold bytes in size)
  - `timeout:` The timeout value in milliseconds (also can be a relative date-time value for clarity, ex: `30s`)

  do_not_connect | if `False` (the default), then a connection will be immediately established to the remote server

Exceptions

  RESTCLIENT-ERROR | invalid option passed to constructor, unsupported data serialization, etc
  SEWIORESTCLIENT-ERROR | missing or invalid required option for Sewio.net's RTLS Studio REST authentication or communication