Jasper web services v2 PDF download not working

I want to download jasper report (pdf) using jasper web services v2 with Node.js & express.js. pl check my code below.

In this code i have got 200 but i cant download the PDF file.

// get const
const Express = require('express');
var  Request =  require('request'),
     QueryString = require('querystring'),
     baseRequest = Request.defaults({
        jar: true
// define 
var app = Express();
// Get PDF
    if(response.body ==="Unauthorized")
       res.send(JSON.stringify({result:'check username and password',Message:'Unauthorized',status:false}));
    }else if(response.body ==="License expired or otherwise not valid"){
      res.send(JSON.stringify({result:'Not Valid',Message:'License expired or otherwise not valid',status:false}));
             baseRequest.get({url:setpath,"content-type": "application/Report+json",body: '<resourceDescriptor></resourceDescriptor> '},(error,response,body)=>{


vjayaram01's picture
Joined: Mar 17 2017 - 11:30pm
Last seen: 6 years 1 day ago

0 Answers:

No answers yet