That’s doing a GET, not a POST ![]()
To POST data as JSON with HomeyScript:
const data = { foo : 'bar', hello : 'world' };
await fetch(URL, {
method: 'POST',
headers: { 'content-type' : 'application/json' },
body: JSON.stringify(data)
});
That’s doing a GET, not a POST ![]()
To POST data as JSON with HomeyScript:
const data = { foo : 'bar', hello : 'world' };
await fetch(URL, {
method: 'POST',
headers: { 'content-type' : 'application/json' },
body: JSON.stringify(data)
});