Why does an HTTP request in Node.js yield the data type as well?
-
29-10-2019 - |
Pergunta
req = http.request options, (res) ->
res.on 'data', (chunk) ->
data += chunk
return
res.on 'end', ->
if res.statusCode is 200
console.log res
console.log data
callback null, data
else
callback(new Error("Response status code: " + res.statusCode), data)
return
return
When I output data, I get:
[object Object][["INZ", 41.878113599999999, -87.629798199999996]]
which is odd because the part after [object Object]
is all good. Any ideas?
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow