the following is a request code. I need to send the cleartext information to the browser.
I know that using res.write () can be output to the browser. But what should I do if I report an error?
request.post({url:ajaxurlip + url, form: {"req":ciphertext}}, function(error,response,body){
if (!error && response.statusCode == 200) {
var resp = JSON.parse(body);
if(resp.status == 0) {
var cleartext = CryptoJS.AES.decrypt(
resp.body,
CryptoJS.enc.Utf8.parse(myAES), {
iv: "",
mode: CryptoJS.mode.ECB
}
);
// cleartext
cleartext = JSON.parse(CryptoJS.enc.Utf8.stringify(cleartext));
res.write(cleartext) //
}
}
})