Skip to content

CheeseCake87/wrpc-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📡 wRPC-JS

This is a small JS library that helps you work with weeRPC.

Installation

CDN

<script src="https://unpkg.com/wrpc-js@latest/cdn.js"></script>

NPM

npm install wrpc-js
import {wrpc} from 'wrpc-js';

Usage

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)
);

About

Generate fetch body data to work with wRPC

Resources

License

Stars

Watchers

Forks