/* 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;"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;
    }"CPSNS: SUB" + input);
} else {
    var body = {};
    var data =;"CPSNS: req.body data" + data);

downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter