Raw data displays but variable will not.
-
I have everything setup that if I copy the data from the console.log after data: that everything is working. As soon as I try to use a variable with that data in it I get a blank report. What could I be missing here? I tried just test and also using JSON.parse(test) and both give blank report.
//console.log(test)
var jsonText = JSON.parse(test)data ={
template:{'shortid': 'ryesCEEQfD'},
data:{jsonText},
options:{
preview:true
}
-
options = {
uri: 'http://localhost:5488/api/report',
method:'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({template:{'shortid': 'ryesCEQEfD'},
data: test
})
-
hi! it is not clear from your description what are you trying to do, what i can guess is that you are trying to send an http request to generate a report, but every time you get a blank report. is that right? what are you using to generate the http request? is it the request module or something else? can you show also what is the content of the
test
variable and the content of the template you are using?
-
That is correct. I solved it and posted the response above.
-
ah ok, i see. try to explain a bit more when writing the comments just to make sure that everybody gets what you are explaining. thanks