You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I am using Espruino on ESP32 to make HTTPS requests. This is working fine for short responses, but it isn't correctly handling long responses with "Transfer-Encoding: chunked"; the chunk size is being emitted in the first "data" event along with the beginning of the response, and then the response is closed.
I see that this issue has been addressed in the past: #1458
I am building from source on the latest master with reduced jsVars because I was getting out of memory issues on the precompiled firmware. Commit: 9a9d8ec
Sample code:
functiongetWeatherForecast(office,gridX,gridY){varpath=`/gridpoints/${office}/${gridX},${gridY}`;varoptions={host: 'api.weather.gov',path: path,method: 'GET',protocol: 'https:',headers: {'User-Agent': 'Espruino','Accept': 'application/geo+json'}};console.log(`GET https://api.weather.gov${path}`);varbody='';varreq=require("http").request(options,function(res){res.on('data',function(data){body+=data;});res.on('close',function(){console.log({code: res.statusCode,headers: res.headers,});console.log(body);});req.on('error',function(err){console.log(`HTTP error ${err.code}: ${err.message}`);console.log(err.stack);});});req.end();}varssid='xxx';varpassword='xxx';varwifi=require('Wifi');wifi.connect(ssid,{password: password},function(err){if(err){console.log(`Failed to connect to wifi: ${err.message}`);console.log(err);return;}console.log(`Connected to Wifi. IP address is: ${wifi.getIP().ip}`);getWeatherForecast('SLC',100,172);});
Hello! I am using Espruino on ESP32 to make HTTPS requests. This is working fine for short responses, but it isn't correctly handling long responses with "Transfer-Encoding: chunked"; the chunk size is being emitted in the first "data" event along with the beginning of the response, and then the response is closed.
I see that this issue has been addressed in the past: #1458
I am building from source on the latest master with reduced jsVars because I was getting out of memory issues on the precompiled firmware. Commit: 9a9d8ec
Sample code:
Output:
Thank you for your work on this project!
The text was updated successfully, but these errors were encountered: