Replies: 2 comments
-
what a lively community ! |
Beta Was this translation helpful? Give feedback.
-
I've been trying to make requests as well, for me the issue was that I was getting a As far as I can tell the problem is that Also So maybe try something like this? const WiFi = require('wifi').WiFi;
const wifi = new WiFi();
wifi.connect({ ssid: 'edimax_2.4G_EF8343', password: 'pass.......' }, (err) => {console.log(err)} )
const http = require('http');
http.get({ host: 'eogywfjtcmeixsk.m.pipedream.net', path: '/', headers: { host: 'eogywfjtcmeixsk.m.pipedream.net' } }, function (response) {
console.log(response.statusCode)
let body = ''
const decoder = new TextDecoder();
response.on('data', function (chunk) {
// Note: chunk is Uint8Array
const txt = decoder.decode(chunk)
body += txt
console.log(txt);
});
response.on('close', function() {
console.log('all done!', body)
})
}); |
Beta Was this translation helpful? Give feedback.
-
Hi could anyone please help?
i'm trying to use http GET but i don't get the data response.
connecting to wifi is successful, but after calling http.get the console shows the function object and does not print the actual data.
this is my code:
and this is what i get in the console:
Beta Was this translation helpful? Give feedback.
All reactions