HTTP/HTTPS transport protocol
This section highlights the details associated with an HTTPS or HTTP connection between the OEM Cloud server and the customer web server. This is a high speed, transport over a HTTP connection. This transport requires that the customer has a publicly facing web server application. OEM Cloud will be the HTTP client and will push any configured published events to the customer's web server. This transport uses basic authentication and therefore HTTPS is recommended. HTTP is available for debugging or troubleshooting.
To configure an HTTP monitor, specify http as the monTransportType setting. Additionally, specify monTransportUrl and monTransportToken options.
monTransportType: (Required) Sets the transport type, TCP or HTTP. For HTTP, set the transport type to HTTP.
monTransportUrl: (Required) Specifies the URL of the customer web server. The URL should be of the following form:
http[s]://customer.domain.com/application/path
monTransportToken: (Required) Specifies the credentials for basic authentication in the following format:
username:password
monTransportMethod: (Optional) Specifies the HTTP method to use to send data: PUT or POST. The default is PUT.
The following example shows how to create an HTTP monitor:
<Monitor> <monTopic>DeviceCore,XbeeCore</monTopic> <monTransportType>http</monTransportType> <monTransportUrl>your website url</monTransportUrl> <monTransportToken>username:password</monTransportToken> <monTransportMethod>PUT</monTransportMethod> <monFormatType>json</monFormatType> <monBatchSize>100</monBatchSize> <monCompression>none</monCompression> <monBatchDuration>10</monBatchDuration> </Monitor>
Protocol
Once the HTTP monitor has been configured, the monitor will be activated and OEM Cloud will connect to the customer's web server. Any matching events will be published to the specified URL using the supplied token credentials. Please note that if the monitor's URL or credentials are configured incorrectly or if the customer's web server is unreachable, OEM Cloud will periodically attempt to connect to the web server for up to 24 hours. The monitor will be disabled after 24 hours without a successful connection.
Events are published using the configured monTransportMethod: PUT or POST. The default is an HTTP PUT operation. The standard HTTP headers of the published event include:
- Authorization: Basic…
- Content-Type: "application/xml;charset=UTF-8" or "application/json;charset=UTF-8"
- Content-Length: indicates how many bytes of payload data are in the message
- [Content-Encoding: deflate] - if present, indicates the monitor event data is compressed
Additionally, the following custom header fields will be set to describe the payload being delivered:
- Monitor-Protocol-Version: indicates what version of push protocol is being used. The current version is '1'.
- Monitor-DataBlockId: a rotating integer ID that identifies the data block.
- Monitor-Aggregate-Count: the number of publish events included in this batch.
The body of the PUT operation is the published event payload data. Its format, compression, and size are indicated in the headers above. The payload data format is the same as for the TCP transport.
The returned HTTP status code indicates the ability of the customer application to receive and process the data:
- 200 - indicates customer application successfully received and processed the data