FEATURES
TUTORIALS
PRICING
RESOURCES
You can make restful API calls from your triggers and stored procedures like this:
There are a large number of functions available for parsing and generating data in JSON format. See the documentation here.
The most heavily used JSON functions are JSON_OBJECT() to create a JSON object and JSON_VALUE() to extract a value from a JSON document. You may also need JSON_LENGTH() to get the length of a JSON array.
This table logs all HTTP request/response data. You can query it for diagnostic purposes.
parasql_http_request | ||
---|---|---|
Column Name | Datatype | Comments |
id | BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY | Unique request identifier. |
request_timestamp | DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | Timestamp of request. |
request_method | ENUM ('GET','POST','PUT','DELETE') NOT NULL DEFAULT 'GET' | Request method. |
request_url | VARCHAR(2048) NOT NULL | The request URL. |
request_headers | JSON | Optional. HTTP request headers in JSON format. |
post_data | MEDIUMTEXT | Optional. Should be called request_body. If this value is NOT NULL then 1) a Content-Length header will be computed and added automatically and 2) a Content-Type header will be added based upon the post_data_encoding column value. |
post_data_encoding | VARCHAR(255) | Optional. The Content-Type header if post_data is NOT NULL. Default is application/x-www-form-urlencoded if not specified. application/json is the most common alternative and the default for requests made via the parasql_http() procedure. |
response_status | INT | HTTP response status code or -1 if an exception is thrown before a response is received. |
response_headers | JSON | HTTP response headers in JSON format. |
response_body | MEDIUMTEXT | HTTP response body or the exception text if response_status = -1 |
callback_procedure | VARCHAR(64) | Optional. The name of the stored procedure to be called for handling the response. |
callback_status | VARCHAR(1024) | Result of callback execution: either COMMIT or ROLLBACK with an associated error message. |
opt_metadata | JSON | Optional. User defined metadata. Useful for linking request/response behavior and diagnostic purposes. |
version | INT | Internal version number. Determines how request/response parameters are processed. |