You can clone with
No one assigned
I've been looking at request for the last couple of days and am now stuck with it. I'm looking for some pointers with the below issues (and also wanted to confirm that the features I'm trying to get working are not broken).
First, if I set headers like so:
I get nothing back (the response callback is never called). The web service I'm trying to talk to only accepts chunked connections, so I have to have it set (without "transfer-encoding: chunked" header the service returns an error "Monitor request must be done on a chunked encoding connection.") So, does request handle chunked connections? If so, are there any special considerations getting it to work?
I can get a "chunked" connection working against the API I'm working with using https.request, but the whole point I'm looking at request instead is that I'd like to keep the TCP connection open and multiplex multiple requests over it (it's the recommended way the web service in question should be accessed). https.request shuts down the socket right away, and so request's "forever()" might solve the problem.
The second question is about forever(). How do I enable it? I saw a suggestion in Google Groups to access forever like so:
var request = require('request').forever();
But when I do that, node exits with:
options.port = port
Thanks for any insights on this!
don't set the content-encoding header by hand, node core's http will automatically use chunked encoding if you don't set a content-length.
Yes, node's core http(s) seems to handle chunked encoding automatically, but it also closes the socket immediately after the request has been made which I'm trying to avoid – there's no way to send another request, say, couple of minutes later using the same socket.
Is there a way to enable chunked connections with your request module, and also employ the "forever" connections that are not automatically closed? In case of this application I'm doing POST over https.