Im trying to simulate a POST request using Hurl.it. Im supposed to be passing in a json parsed by this nodejs:
https://github.com/quique123/aismarthome/blob/master/app.js
app.post('/api/switches/:id', function(req, res){
console.log('headers: ' + JSON.stringify(req.headers));
console.log('body: ' + JSON.stringify(req.body));
console.log('params: ' + JSON.stringify(req.params));
const assistant = new Assistant({request: req, response: res});
let soc = assistant.getArgument('state-of-component');
let comp = assistant.getArgument('Component');
...})
Here are the results of Hurl.it:
...
via marciokoko
No comments:
Post a Comment