Hi,
I have implemented the below code in an attempt to get the contents of a binary file to store in a variable for later processing in the response rule but I only get the first line of the binary file instead of the whole content, please assist in where I might be going wrong.
var ctx = session.name('myContext') || session.createContext('myContext');
session.input.readAsBuffer(function (error, buffer) {
if (error)
{
// handle error
session.output.write (error.errorMessage);
} else {
/* write the default output buffer*/
const testvar = buffer;
ctx.setVariable('binary', testvar.toString());
session.output.write (buffer);
}
});
#DataPower#Support#SupportMigration