http
- Description:
- 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)
- Description:
- Executes an HTTP DELETE request towards the device.
Example
D.device.http.delete(options, callback)
Parameters:
Name |
Type |
Description |
options |
HttpOptions
|
The HTTP request execution options |
callback |
HttpCallback
|
The HTTP request execution callback |
(static) get(options, callback)
- Description:
- Executes an HTTP GET request towards the device.
Example
D.device.http.get(options, callback)
Parameters:
Name |
Type |
Description |
options |
HttpOptions
|
The HTTP request execution options |
callback |
HttpCallback
|
The HTTP request execution callback |
(static) getTLSCertificate(options, callback)
- Description:
- Retrieves the TLS certificate of the server.
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"}
Parameters:
Name |
Type |
Description |
options |
HttpOptions
|
The HTTP request execution options |
callback |
HttpCallback
|
The TLS info callback |
(static) post(options, callback)
- Description:
- Executes an HTTP POST request towards the device.
Example
D.device.http.post(options, callback)
Parameters:
Name |
Type |
Description |
options |
HttpOptions
|
The HTTP request execution options |
callback |
HttpCallback
|
The HTTP request execution callback |
(static) put(options, callback)
- Description:
- Executes an HTTP PUT request towards the device.
Example
D.device.http.put(options, callback)
Parameters:
Name |
Type |
Description |
options |
HttpOptions
|
The HTTP request execution options |
callback |
HttpCallback
|
The HTTP request execution callback |