HTTP Mode
Identified with the label
HTTP
, the HTTP Mode of Layrz Protocol is designed for 100% reliable communication over the internet using the HTTP protocol. This mode is particularly useful for applications that require a robust and secure connection, but not necessarily real-time communication.Features
- Reliable Connection: I mean, It's HTTP, so it ensures that all packets are delivered without loss.
- Security: HTTP can be secured using HTTPS, providing encryption and authentication.
- Compatibility: HTTP is widely supported and can be easily integrated with existing web services and APIs.
Disadvantages
- Latency: HTTP is not designed for real-time communication, so it may introduce some latency compared to TCP.
HTTP endpoints
POST
/v2/message
Register a new message to the server.
Headers
Header | Value | Description |
---|---|---|
Content-Type | text/plain | The content type of the message. |
Authorization | LayrzAuth {IDENT};{PASSWORD} | The ident and password of the device. |
Body
Any of Pb, Pc, Pd, Pi, Pm, Po, Pr or Ps
Response
POST
/v2/image/{FILENAME}
Deprecated on v2.7.0
Upload an image to the server.
Deprecated on v2.7.0
in favor of the Pm packet.Path Parameters
Parameter | Type | Description |
---|---|---|
FILENAME | string | The name of the file to upload. This should be a valid filename, without the extension. |
Headers
Header | Value | Description |
---|---|---|
Content-Type | image/jpeg | The content type of the image. |
Authorization | LayrzAuth {IDENT};{PASSWORD} | The ident and password of the device. |
Body
The base64 encoded image data, with the content type included in the base64 string.
data:image/jpeg;base64,...
Response
GET
/v2/commands
Get the command queue of the device.
Headers
Header | Value | Description |
---|---|---|
Content-Type | application/json | The content type of the request. |
Authorization | LayrzAuth {IDENT};{PASSWORD} | The ident and password of the device. |
Response
POST
/v2/commands
Removed on v2.3.0
Register a command ACK to the server.
Headers
Header | Value | Description |
---|---|---|
Content-Type | application/json | The content type of the request. |
Authorization | LayrzAuth {IDENT};{PASSWORD} | The ident and password of the device. |
Body
Exactly the Pc packet.
Response
GET
/v2/ble
Added on v2.5.0 Deprecated on v2.7.0
Gets the available BLE devices that can be sniffed by the device.
Deprecated on v2.7.0
in favor of the Pr packet.Headers
Header | Value | Description |
---|---|---|
Content-Type | application/json | The content type of the request. |
Authorization | LayrzAuth {IDENT};{PASSWORD} | The ident and password of the device. |