0
I want to use the API fetch instead of the http(Node) module. However, I’m not getting the end of the request.
var req = http.request(options, res => {
res.setEncoding("utf8");
res.on('data', () => {
//como entro nesse trecho com o fetch ???
});
res.on("end", () => {
//como entro nesse trecho com o fetch ???
});
});
I want to catch these "events" with the fetch ???
fetch(_end, options)
.then(res => {
res.on('data', () => {
//Não exite esse res.on utilizando o fetch
});
res.on("end", () => {
//Não exite esse res.on utilizando o fetch.
});
})
.catch(err => {
...
});
Can anyone give me any hint on how to do this using the fetch API.
Want to use fetch in browser or Node?
– Sergio
fetch on Bowser
– frontend
use in Chrome browser
– frontend