Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zadockmaloba authored May 1, 2024
1 parent 7607029 commit f80b7da
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
# jsonrpc.framework.net
# jsonrpc.framework.net

A simple to use framework for json rpc requests

## Example

```
public partial class LoginPage : ContentPage
{
private readonly jsonrpc.RPCClient rpc = new("http://192.168.1.66:8069/jsonrpc");
public LoginPage()
{
InitializeComponent();
}
private void OnLoginClicked(object sender, EventArgs e)
{
_ = rpc.Invoke("call", new {
service = "common",
method = "login",
args = new string[] { "bitnami", UnameField.Text, PasswordField.Text }
}, onResponse);
}
private async void onResponse(jsonrpc.RPCResponse response)
{
Debug.WriteLine(response);
if(response.Error != null)
{
Debug.WriteLine(response.Error);
await DisplayAlert("RPC Error", response.Error.ToString(), "Cancel");
}
}
private void ImageLoaded(object sender, EventArgs e)
{
Debug.WriteLine(ImageSplash);
}
}
```

0 comments on commit f80b7da

Please sign in to comment.