This is a small JS library that helps you work with weeRPC.
<script src="https://unpkg.com/wrpc-js@latest/cdn.js"></script>
npm install wrpc-js
import {wrpc} from 'wrpc-js';
fetch(
'http://127.0.0.1:5000/rpc/clients',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: wrpc(
function_ = 'add',
data = {
'name': 'John Doe',
}
),
}
).then(
response => response.json()
).then(
data => console.log(data)
);