Introduction
The Generic HTTP Web Service (GHoWSt) project supports mapping native programming language semantics (domain objects, class methods, method arguments) to and from basic HTTP requests in a generic, dynamic way based on convention. HTTP methods (GET, POST, PUT, PATCH, DELETE) are used to work with resources as usual. This then all happens in reverse on the server.
The programmatic client uses any available dynamic proxy to translate class method calls to HTTP on the fly. In the case of C, the calling functions are written manually, but the invoker still does most of the lower level work. The server is getting more dynamic over time and presently uses a Java servlet. All the above might also be better understood with a pretty picture:
Motivation
GHoWSt doesn't involve hypermedia, a separate domain specific language, or special compiler, or call for something like an OpenAPI Specification (OAS). If the server, in this case Java, uses interfaces, it translates it and serves that as HTML at the root service URL to aid the human programmer. Making OPTIONS requests to resources is being added.
I made this for a variety of reasons, including to help me learn and practice a variety of languages and toolchains, as well as a simple way for members of my household to do fun and silly networking stuff with whatever language is the easiest for them to use!
Currently supported languages and their client and server GitHub repositories
- Client in C
- Client in Java
- Server in Java - serves a basic HTML client as well
- Client in Python
- Client in Ruby
- Client in PHP
- Client in JavaScript
Further information
- GitHub Weburg organization where you can explore many of the repositories mentioned
- Related project team and relevant repositories if you're interested in helping (requires a GitHub account and team membership)