This snippet shows how to use the handleError and handleResponse functions from the splunk-utils package to send a POST request from a Splunk app: