/* This will come in the body at XML but the header will be text/plain, which is why
all this is happening manually to get this read from the stream.
*/
var reqHeaders = request.headers;
gs.info("CPSNS: reqHeaders content-type" + reqHeaders['content-type']);
if (reqHeaders['content-type'] == "text/plain; charset=UTF-8") {
var stream = request.body.dataStream;
var reader = new GlideTextReader(stream);
var input = "";
var ln = "";
while ((ln = reader.readLine()) != null) {
input += ln;
}
gs.info("CPSNS: SUB" + input);
} else {
var body = {};
var data = request.body.data;
gs.info("CPSNS: req.body data" + data);
}
Comments