The Device HTTP library.
Allows drivers to execute HTTP(s) requests towards the device.
Example
D.device.http
See HTTP Driver Examples
Methods
(static) delete(options, callback)
Executes an HTTP DELETE request towards the device.
Parameters:
Name | Type | Description |
---|---|---|
options |
HttpOptions | The HTTP request execution options |
callback |
HttpCallback | The HTTP request execution callback |
Example
D.device.http.delete(options, callback)
(static) get(options, callback)
Executes an HTTP GET request towards the device.
Parameters:
Name | Type | Description |
---|---|---|
options |
HttpOptions | The HTTP request execution options |
callback |
HttpCallback | The HTTP request execution callback |
Example
D.device.http.get(options, callback)
(static) getTLSCertificate(options, callback)
Retrieves the TLS certificate of the server.
Parameters:
Name | Type | Description |
---|---|---|
options |
HttpOptions | The HTTP request execution options |
callback |
HttpCallback | The TLS info callback |
Examples
D.device.http.getTLSCertificate(options, callback)
// callback returns (error, TLSData) where TLSData has the following format
{"issuer": "Issuer name", "expiry": "Apr 12 23:59:59 2015 GMT", "valid": false, "certError": "CERT_HAS_EXPIRED"}
(static) post(options, callback)
Executes an HTTP POST request towards the device.
Parameters:
Name | Type | Description |
---|---|---|
options |
HttpOptions | The HTTP request execution options |
callback |
HttpCallback | The HTTP request execution callback |
Example
D.device.http.post(options, callback)
(static) put(options, callback)
Executes an HTTP PUT request towards the device.
Parameters:
Name | Type | Description |
---|---|---|
options |
HttpOptions | The HTTP request execution options |
callback |
HttpCallback | The HTTP request execution callback |
Example
D.device.http.put(options, callback)