Skip to content

Commit

Permalink
Explain usage of method id in /rpc endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Odonno committed May 1, 2024
1 parent fa230c5 commit b294f6e
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions doc-surrealdb_versioned_docs/version-1.x/integration/rpc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1267,3 +1267,49 @@ Notice how the deleted record is being returned here
}
}
```

## Methods

For each request, you can send the `method` using its name (e.g. `ping`).
However, you can also use the method's id (e.g. `1` for `ping`).
Here the list of methods and their corresponding ids:

| Method | ID |
| --- | --- |
| `ping` | 1 |
| `info` | 2 |
| `use` | 2 |
| `signup` | 4 |
| `signin` | 5 |
| `invalidate` | 6 |
| `authenticate` | 7 |
| `kill` | 8 |
| `live` | 9 |
| `let` or `set` | 10 |
| `unset` | 11 |
| `select` | 12 |
| `insert` | 13 |
| `create` | 14 |
| `update` | 15 |
| `merge` | 16 |
| `patch` | 17 |
| `delete` | 18 |
| `version` | 19 |
| `query` | 20 |

### Example usage
```json title="Request using method id"
{
"id": 1,
"method": 2
}
```

This request example is equivalent to the following:

```json title="Request using method name"
{
"id": 1,
"method": "info"
}
```

0 comments on commit b294f6e

Please sign in to comment.