KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
jsonrpc
★ 10
Open GitHub ↗
Sandwych.JsonRpc: A JSON-RPC Client For .NET
Download README (.md)
Explore Similar Repositories
NodeRevision
:
No description available.
angular2-collapsible
:
Angular collapsible component styled with Materialize CSS.
musicbrainz_rust
:
A MusicBrainz API client for Rust.
chat
:
No description available.
scaffold
:
react脚手架,react+react-router。支持懒加载(bundle-loader或dynamic-import),支持热加载(react-hot-loader),支持ES6和部分ES7语法。
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
jsonrpc
?
Download (.md)
# Sandwych.JsonRpc: A JSON-RPC Client For .NET [](https://www.nuget.org/packages/Sandwych.JsonRpc) [](https://ci.appveyor.com/project/oldrev/jsonrpc/branch/master) Sandwych.JsonRpc is a JSON-RPC protocol client for .NET. WARNING: This library should be considered *PRE-BETA* software - the API can and will change frequently, do not use it for production. ## Getting Started ### Prerequisites * Visual Studio 2017: This project is written in C# 7.0 using Microsoft Visual Studio 2017 Community Edition. ### Supported Platform * .NET Framework 4.5+ * .NET Standard 1.3+ (including .NET Core, Xamarin and others) ### Installation Sandwych.JsonRpc can be installed from [NuGet](https://www.nuget.org/packages/Sandwych.JsonRpc) or type following commands in the NuGet Console: ``` PM> Install-Package Sandwych.JsonRpc ``` ## Demo & Usage: ### Step 1: Define your JSON-RPC interface: ```csharp [JsonRpcService("/projects/jayrock/demo.ashx")] public interface ITestJsonRpcService { [JsonRpcMethod("echo")] Task<string> EchoAsync(string text); [JsonRpcMethod("total")] Task<int> TotalAsync(IEnumerable<int> values); } ``` ### Step 2: Call your JSON-RPC using a dynamic proxy approach: ```csharp var settings = new Settings(); //Use default settings var client = new HttpClient { BaseAddress = new Uri("http://www.raboof.com") }; var service = RpcProxyFactory.CreateProxyInstance<ITestJsonRpcService>(client, settings); //Create a dynamic proxy for the interface ITestJsonRpcService var echoResult = await service.EchoAsync("hello"); Console.WriteLine(echoResult); //Should print "hello" ``` And done! # License Author: Wei Li <oldrev(at)gmail.com> This software is licensed in 3-clause BSD License. Copyright (C) 2017-TODAY BinaryStars Technologies Yunnan LLC.