I'm writing a Restful api with node js and I'm facing a weird problem: I'm testing the API using a Chrome extension called postman and sending the json object below:
{
"items": [
{
"appid": 730,
"classid": "2222",
"id": 99,
"instanceid": "instanceID",
"market_name": "Market name"
},
{
"appid": 730,
"classid": "2222",
"id": 99,
"instanceid": "instanceID",
"market_name": "Market name"
}
],
"message": "Mensagem de teste",
"user": 76561197960275584
}
My problem is with the "user" property. When getting it from the server it returns me 76561197960275580 but the value sent was 76561197960275584. When I send it using string it works but when sending as number - which is like the consumer of the api sends data - it gives me this problem.
Here is some of my API code. It is using express 4.
var express = require('express');
var bodyParser = require('body-parser');
var api = express();
api.use(bodyParser.urlencoded({ extended: false }));
api.use(bodyParser.json());
api.post('/import', function importEndPoint(req, res) {
console.log('req.body.user=' + req.body.user);
});
Does anyone would have a tip for me to solve it?
Thanks in advance for any help.