Closed pranavs80 closed 11 years ago
Since this stream is so short, you may as well buffer it and then use JSON.parse
,
JSONStream is only really useful when the json is a long array, but this is too nested.
ok. but this json stream will be posted from some 3rd party site to my node js code. so how do i read that ?
this module is popular: this https://github.com/mikeal/request
you mean you will retrive the json with an http request?
yes. i will be running my node js program on for e.g. http://123.123.123.123:3000
so on this link i must be able to read that request.
Thank u very much..
var express = require('express'); var app = express();
app.configure(function(){ //app.use(express.static(__dirname + '/public')); app.use(express.bodyParser()); });
app.post('/', function(req, res){ console.log(req.body); }app.listen(8001);
u can post any request to your node js program using SEND HTTP TOOL.
Hello,
I was going through your link https://github.com/dominictarr/JSONStream
I also want to read some post data same way you have given example.
My json stream is as http://190.120.229.112/swimapp/test.txt
i will be posting this stream and wanted to read this in node js code.
can u please help me out.
thanks pranav