https://github.com/cheesecake87/weerpc
The wee RPC protocol.
https://github.com/cheesecake87/weerpc
Last synced: 5 months ago
JSON representation
The wee RPC protocol.
- Host: GitHub
- URL: https://github.com/cheesecake87/weerpc
- Owner: CheeseCake87
- License: mit
- Created: 2024-04-18T11:17:14.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T08:21:50.000Z (about 2 years ago)
- Last Synced: 2025-10-09T12:32:14.759Z (8 months ago)
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📡 weeRPC
The wee RPC (weeRPC) protocol is a JSON POST request based protocol which is design to be small.
(Wee - meaning small in Scottish slang)
Known libraries that use weeRPC:
- [weeRPCjs](https://github.com/CheeseCake87/weeRPCjs)
- [Flask-RPC](https://github.com/CheeseCake87/flask-rpc)
- [Quart-RPC](https://github.com/CheeseCake87/quart-rpc)
### Version 1.1
Changes:
- `wrpc` key changed to `weerpc` to better reflect the naming.
#### Request
`weerpc`: This is the version of weeRPC you are using which tells the server to validate that the JSON data includes what the version expects.
`function`: A string value that contains the name of the function to run.
`data`: JSON serializable data that is passed to the function as an argument.
#### Response
`weerpc`: The server sends back what version of weeRPC it's using to process requests/responses.
`ok`: A bool [true/false] value returned to be used to easily check if a response has been successful.
`message`: OPTIONAL This value may or may not be sent back. It is used to send back more information.
`data`: The data returned as the result from running the function called in the request.
**A typical request/response cycle is as follows:**
**Request**
```json
{
"weerpc": 1.1,
"function": "add_numbers",
"data": [
1,
2,
3
]
}
```
**Response**
```json
{
"weerpc": 1.1,
"ok": true,
"message": "Function 'add_numbers' executed successfully",
"data": 6
}
```
### Version 1
#### Request
`wrpc`: This is the version of weeRPC you are using which tells the server to validate that the JSON data includes what the version expects.
`function`: A string value that contains the name of the function to run.
`data`: JSON serializable data that is passed to the function as an argument.
#### Response
`wrpc`: The server sends back what version of weeRPC it's using to process requests/responses.
`ok`: A bool [true/false] value returned to be used to easily check if a response has been successful.
`message`: OPTIONAL This value may or may not be sent back. It is used to send back more information.
`data`: The data returned as the result from running the function called in the request.
**A typical request/response cycle is as follows:**
**Request**
```json
{
"wrpc": 1.0,
"function": "add_numbers",
"data": [
1,
2,
3
]
}
```
**Response**
```json
{
"wrpc": 1.0,
"ok": true,
"message": "Function 'add_numbers' executed successfully",
"data": 6
}
```