Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post('/predixcall', function(req, res){
- var list = req.body.list;
- var id= req.body.vesselId;
- var requestInfo = {
- tags: []
- };
- for(var i = 0; i < list.length; i++){
- requestInfo.tags.push({
- "name": list[i],
- "filters": {
- "attributes": {
- "id": id
- }
- },
- "order": "asc"
- });
- }
- request.post({
- uri:'http://localhost:3000/api',
- headers:{
- 'Content-Type': 'application/text; charset=utf-8'
- },
- body: JSON.stringify(requestInfo)
- },function (error, response, body) {
- console.log('Error is ', error);
- res.send(JSON.parse(response.body));
- }
- );
- });
- Error is undefined { Error: Parse Error
- at Error (native)
- at Socket.socketOnData (_http_client.js:363:20)
- at emitOne (events.js:96:13)
- at Socket.emit (events.js:188:7)
- at readableAddChunk (_stream_readable.js:176:18)
- at Socket.Readable.push (_stream_readable.js:134:10)
- at TCP.onread (net.js:548:20) bytesParsed: 754, code: 'HPE_UNEXPECTED_CONTEN
- T_LENGTH' }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement