Skip to content

Commit

Permalink
Add REST example #176
Browse files Browse the repository at this point in the history
WebSockets example #170

- added preliminary documentation
- improved WebClient.cs
  • Loading branch information
mpostol committed Apr 30, 2020
1 parent e5c56db commit 62838b8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
23 changes: 23 additions & 0 deletions DistributedProgramming/ClientServerCommunication/RESTAPI/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Notes

This example is derived from [REST client; MSDN Documentation][RESTClient]
A practical use case is covered by the project [M. Postol; Object-Oriented Internet; Global Data Discovery][OOI-GDD]

## Executive summary

The formal REST constraints are as follows:

- Client-server architecture
- Statelessness
- Cacheability
- Layered system
- Code on demand (optional)
- Uniform interface

## See also

- [Standards.REST](https://standards.rest/) A collection of standards and specifications, that help make fantastic HTTP/REST APIs. Don't reinvent the wheel, use fantastic wheels, hashed out by experts, that solve problems you hadn't even considered yet.
- [REST client; MSDN Documentation][RESTClient]

[RESTClient]: https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/console-webapiclient
[OOI-GDD]: https://commsvr.gitbook.io/ooi/global-data-discovery/datadiscovery
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace TPD.Communication.ClientServerCommunication.RESTAPI
{
//TODO client derived from https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/console-webapiclient
public class WebClient : IDisposable
{
private readonly HttpClient m_Client = new HttpClient();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# WebSocket notes

The example has been derived from the project [M. Postol; NBlockchain; NBlockchain/P2PPrototocol/NodeJSAPI/][WSExampleInBlockchain]

## Introduction

The WebSocket Protocol enables two-way communication between a client running untrusted code in a controlled environment to a remote host that has opted-in to communications from that code. The security model used for this is the origin-based security model commonly used by web browsers. The protocol consists of an opening handshake followed by basic message framing, layered over TCP. The goal of this technology is to provide a mechanism for browser-based applications that need two-way communication with servers that does not rely on opening multiple HTTP connections (e.g., using XMLHttpRequest or \<iframe\>s and long polling).

## See also

- [The WebSocket Protocol; Request for Comments: 6455; 2011](https://tools.ietf.org/html/rfc6455)
- [The WebSocket API; W3C Candidate Recommendation 20 September 2012](https://www.w3.org/TR/websockets/)
- [M. Postol; NBlockchain; NBlockchain/P2PPrototocol/NodeJSAPI/; Rel.1.0][WSExampleInBlockchain]

[OOI-GDD]: https://commsvr.gitbook.io/ooi/global-data-discovery/datadiscovery
[WSExampleInBlockchain]: https://github.com/mpostol/NBlockchain/tree/master/P2PPrototocol/NodeJSAPI

0 comments on commit 62838b8

Please sign in to comment.