a.manojkumar1987 Posted April 25, 2017 Posted April 25, 2017 var http = require("http");//var app = express();var request = require("request"); http.createServer(function (req, res) { request.post({url: "http://localhost:8080/jasperserver/rest_v2/login", qs: {j_username: "jasperadmin", j_password: "jasperadmin"}},function(err, res1, body1) {if(err) {return console.error(err);} request.get({url:"http://localhost:8080/jasperserver/rest_v2/reports/reports/JREPORT.pdf",qs: {j_username: "jasperadmin" , j_password:"jasperadmin"} },function(error, response, body) {// console.log(body);res.writeHead(200 ,{'Content-Type': 'application/pdf'})res.end(body); });});}).listen(8081);console.log("Server is running n 8081");It returns the pdf page empty but when i run the rest_v2 it shows the pdf with data, please help
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now