http-server

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Command http-server exposes a small calculator over JSON-RPC 2.0 on HTTP.

go run ./examples/http-server

Then, in another terminal:

curl -s localhost:8080/rpc -d '{"jsonrpc":"2.0","method":"add","params":{"a":2,"b":40},"id":1}'
curl -s localhost:8080/rpc -d '[{"jsonrpc":"2.0","method":"add","params":{"a":1,"b":1},"id":1},{"jsonrpc":"2.0","method":"mul","params":{"a":6,"b":7},"id":2}]'

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL