Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gregamohorko/bluewsclient.net
.NET client library for BlueWS library.
https://github.com/gregamohorko/bluewsclient.net
async async-await asynchronous client-library csharp-library json rest web-service-client webservice
Last synced: 3 days ago
JSON representation
.NET client library for BlueWS library.
- Host: GitHub
- URL: https://github.com/gregamohorko/bluewsclient.net
- Owner: GregaMohorko
- License: apache-2.0
- Created: 2017-05-30T11:23:33.000Z (over 7 years ago)
- Default Branch: dev
- Last Pushed: 2023-12-22T02:16:24.000Z (11 months ago)
- Last Synced: 2024-04-27T04:34:52.623Z (7 months ago)
- Topics: async, async-await, asynchronous, client-library, csharp-library, json, rest, web-service-client, webservice
- Language: C#
- Size: 163 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# BlueWSClient.NET
A client library in .NET for [BlueWS](https://github.com/GregaMohorko/BlueWS) library. Includes logic and utility for calling BlueWS web service actions.[![Release](https://img.shields.io/github/release/GregaMohorko/BlueWSClient.NET.svg?style=flat-square)](https://github.com/GregaMohorko/BlueWSClient.NET/releases/latest)
[![NuGet](https://img.shields.io/nuget/v/BlueWS.svg?style=flat-square)](https://www.nuget.org/packages/BlueWS)## Documentation & Tutorials
You can read the documentation and tutorials under the [Wiki](https://github.com/GregaMohorko/BlueWSClient.NET/wiki).## Short examples
Creating a web service instance:
```C#
var webService = new WebService("https://www.myserver.com/", HttpMethod.Get);
```Getting the response for an action *TestAction*:
```C#
var request = new Request(webService);
JObject response = request.Call("TestAction");
```The above example was synchronous and blocked the calling thread.
The asynchronous call looks like this:
```C#
JObject response = await request.CallAsync(nameof(TestActionAsync));
```To send parameters to the server, add them to the ```Parameter``` property of the request before calling:
```C#
request.Parameters.Add("TheAnswer",42);
JObject response = request.Call();
```To get the response in your own type:
```C#
var request = new Request(webService);
YourClass response = request.Call("TestAction");
```## Requirements
.NET Standard 2.0## Author and License
Gregor Mohorko ([www.mohorko.info](https://www.mohorko.info))
Copyright (c) 2023 Gregor Mohorko
[Apache License 2.0](./LICENSE.md)