Calls a custom API handler defined on the database with DEFINE API.
Arguments
| Argument | Description |
|---|---|
path | The API path to call. |
method | The HTTP method. Defaults to "GET". |
session | An optional session id. |
txn | An optional transaction id. |
The api() method for the SurrealDB Mojo SDK calls a custom API handler defined on the database.
Calls a custom API handler defined on the database with DEFINE API.
| Argument | Description |
|---|---|
path | The API path to call. |
method | The HTTP method. Defaults to "GET". |
session | An optional session id. |
txn | An optional transaction id. |