Hi.
I am just beginning to work with HTTP and node js.
I have been researching this bug in the past week to no avail and I tried
bug fixes mentioned in the links provided below.
So my task is to talk to a data source and send the data to S3. The server
(data source) does chunked transfer encoding.
I do restify.createJSONClient() and I get a 200 response from the server.
But after this the ondata() and onend() events never get called. However I
have an @data: => in the constructor of this class and that gets fired.
I get a sockethangup exception. My version of node is 10.9
I have tried setting Connection:Keep-Alive in the options header of the
request and user-agent as node js. I have a req.end() method.
I used curl to talk to the server and it is a Microsoft II5 7.5 and
Content-Type application/xml that does chunked transfer encoding by
default. So maybe I need'nt even use node here ? But why are the ondata
event not fired ?
options:
url: "url"
path: "query string"
method: 'GET'
headers:
"Content-Type": "application/x-www-form-urlencoded"
"Connection": "Keep-Alive"
"user-agent": "node.js"
client = restify.createJsonClient
url: "url"
##connectTimeout: 15 * 10000
client.basicAuth server.username, server.password
client.get options, (err, req, res, body) =>
if res.statusCode == 200
req.on 'result', (result) =>
console.log 'Result recd' + result
res.on "data", (chunk) =>
console.log "Data flowing.."
@stringBuffer += chunk
console.log chunk
res.on "end", (end) =>
console.log "end of stream"
req.write(@stringBuffer)
req.end()
.on "error", (err) =>
console.log "Error during connection"
.close()
do callback if callback
I have checked the indentation errors and they are ok. I am really not sure
what the bug is. It will be great if someone can point out.
Thanks
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.