Skip to content

Instantly share code, notes, and snippets.

@robertz
Last active February 24, 2021 01:19
Show Gist options
  • Save robertz/9b263b99b1c3c1d13d77b2ca2596fe2b to your computer and use it in GitHub Desktop.
Save robertz/9b263b99b1c3c1d13d77b2ca2596fe2b to your computer and use it in GitHub Desktop.
ChronService.cfc
component{
function log (required struct criteria) {
cfhttp(url = "https://api.kisdigital.com/chron/log", method = "POST", charset = "utf-8"){
cfhttpparam(type = "header", name = "Content-Type", value = "application/json");
cfhttpparam(type = "body", value = serializeJSON({
"appid": "e92c801d-659a-4548-8a16-b79f6b37cf2d",
"type": criteria.keyExists("type") ? criteria.type : "information",
"log": criteria.keyExists("log") ? criteria.log : "default",
"message": criteria.keyExists("message") ? criteria.message : "No message."
}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment