Skip to content

ch1c0t/hobby-rpc.protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Introduction

Hobby-RPC is a request-response protocol over HTTP messages.

Clients send JSON in the POST request's body and receive JSON in the response. They can call nullary and unary functions.

Nullary functions

To call a nullary function, a client should pass a function name(as the fn property). For example, to call a function named SomeNullaryFunction with curl:

curl -H "Content-Type: application/json" -X POST -d '{"fn":"SomeNullaryFunction"}' https://some.domain

Unary functions

To call an unary function, a client should pass a function name(as the fn property) and its input(as the in property). For example, to call a function named SomeUnaryFunction with curl:

curl -H "Content-Type: application/json" -X POST -d '{"fn":"SomeUnaryFunction","in":42}' https://some.domain

Responses

Servers can respond with:

Authorization

Servers may choose to require clients to be authorized. In such cases, they will forbid any requests except those with valid tokens.

Clients may pass tokens as follows:

curl -H "Content-Type: application/json" -H "Authorization: SomeToken" -X POST -d '{"fn":"SomeNullaryFunction"}' https://some.domain

Implementations

Servers

Clients

About

A description of the Hobby-RPC protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published