updateCurrentState - add URL request option
See original GitHub issueHi, it would be great if you can expand a “updateCurrentState” method with ability to call URL on state change. I’ve an alarm system, which I can trigger with URL link. What I want to do is to call “alarm on” URL when alarm is triggered and “alarm off” URL when alarm is disabled. For URL request you could use something like:
var url = require('url');
...
this.alarmOnUrl = url.parse(config['alarmOnUrl']);
...
request({
url: me.alarmOnUrl,
method: 'GET',
},
function (error, response, body) {
if (error) {
// me.log('STATUS: ' + response.statusCode);
// me.log(error.message);
return callback(error);
}
There should be option to define(optional) URL for every state (armed, triggered, …).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
OPTIONS - HTTP - MDN Web Docs
The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, ......
Read more >Why am I getting an OPTIONS request instead of a GET ...
it does an OPTIONS request to that URL, and then the callback is never called with anything. When it isn't cross domain, it...
Read more >got/2-options.md at main · sindresorhus/got - GitHub
The HTTP method used to make the request. The most common methods are: GET , HEAD , POST , PUT , DELETE ....
Read more >HTTP | Node.js v19.3.0 Documentation
To get the response, add a listener for 'response' to the request object. 'response' will be emitted from the request object when the...
Read more >HTTP/1.1: Method Definitions
The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Works perfect! Thanks for the quick implementation.
You’re welcome! Feel free to follow-up this issue if there’s anything regarding this feature that could be improved or fixed.