http.request appears to lack ability to deal with chunking
Posted: 03 Dec 2017 12:21
I'm trying to use http.request to get status information from an alarm system.
After some fiddling I managed to get the first part of the response, but not the details I required.
Doing the same query from a small node.js application I believe the problem is that the data is coming back in chunks and I'm only getting the first one back using http.request
I using the asynch mode in the hope it would do repeated calls to responses, but both method success and complete only get called once.
At this stage only way to solve this that I can see is to setup an intermediate web-server that extracts the information required and makes available for http.request in z-wave.me module or another web server that get data from alarm and then call in to the JS functions of z-wave.me. Both call for complexity of another web server which isn't ideal.
I'm also going to see if I can use the socket API to do my own http client implementation.
I can't find the source for http.request anywhere to investigate - I assume this is part of the C implementation which isn't made public.
Appreciate any workarounds or fixes you can suggest.
After some fiddling I managed to get the first part of the response, but not the details I required.
Doing the same query from a small node.js application I believe the problem is that the data is coming back in chunks and I'm only getting the first one back using http.request
I using the asynch mode in the hope it would do repeated calls to responses, but both method success and complete only get called once.
At this stage only way to solve this that I can see is to setup an intermediate web-server that extracts the information required and makes available for http.request in z-wave.me module or another web server that get data from alarm and then call in to the JS functions of z-wave.me. Both call for complexity of another web server which isn't ideal.
I'm also going to see if I can use the socket API to do my own http client implementation.
I can't find the source for http.request anywhere to investigate - I assume this is part of the C implementation which isn't made public.
Appreciate any workarounds or fixes you can suggest.