HTTP-Based Connection


You can use the HTTP protocol to report real-time data collected by devices to EnOS. Connections based on the HTTP protocol currently only support data reporting from devices to EnOS, as well as the upload and download of file-type data.


The process for devices to communicate with EnOS via the HTTP protocol is as follows:

  1. Integrate device authentication keys (Product key, Device key, Device secret) on the device side. Refer to Retrieving Device Triple Information.

  2. The device connects to EnOS via the HTTP or HTTPS protocol and pushes data to EnOS.


You can retrieve device data, modify measurement point attributes, issue commands, and display the retrieved data in applications using EnOS APIs.

HTTP Ports


Domain

Port

Protocol

Usage

iot-http-{env}

443

HTTPS

Device Connection

iot-http-{env}

8080

HTTP

Device Connection. It is recommended to use this when the security requirement is relatively low.

iot-http-integration-{env}

443

HTTPS

Message Integration

iot-http-integration-{env}

8080

HTTP

Message Integration. It is recommended to use this when the security requirement is relatively low.

Where, “{env}” is the domain name of the EnOS environment. For example, if your logged-in EnOS domain is “app-portal-eu2.envisioniot.com”, the domain name will be “iot-http-eu2.envisioniot.com”.

HTTP Protocol Versions


EnOS supports connection over the following HTTP versions.

  • Hypertext Transfer Protocol - HTTP/1.0 protocol. See RFC 1945.

  • Hypertext Transfer Protocol — HTTP/1.1 protocol. See RFC 2616.

Connection Security


EnOS supports either HTTP or HTTPS. You can opt for HTTPS to ensure connection security.

Limitations


  • HTTP-based connection uses the same topic specifications as MQTT. The topic for uploading device data is https://{HTTP-Broker-URL}/topic/{Topic}, where the variable {Topic} is the same as the real-time-data-uploading topic for MQTT.

  • The formats of requests and responses over HTTP are the same as those for MQTT.

  • The error codes in responses over HTTP are the same as those in MQTT.

  • Only the POST method is supported for a request over HTTP.

  • Content-Type in the header of a device authentication request over HTTP must be application/json.

  • Content-Type in the header of a device-data-uploading request over HTTP must be application/octet-stream.