this web server implement API server with following conditions:
- use JSON RPC as its API format
- use thread for its server (http_worker)
and following library:
- cJSON
- http-parser
this API using JSON-RPC as data format. please learn it before continue in this documentation. for limit and offset it use same concept as in sql limit and offset
note: please look carefully about data type int or string mean alot.
- forever start --spinSleepTime 500 -c build/api.run api.sock
example:
- send
{
"jsonrpc": "2.0",
"method": "school.get",
"params": {
"id": 1
},
"id": 12131
}
- retrieve
{
"jsonrpc": "2.0",
"result": {
"id": 1,
"code": 1001,
"name": "SDN Gegerkalong KPAD",
"level": "elementary"
},
"id": 12131
}
just an utility, for ping (checking connection maybe)
- sent:
- method: ping
- params: (no params)
- receive:
- string "ok"
example sent:
{
"jsonrpc": "2.0",
"method": "ping",
"id": 421321
}
example retrieve:
{
"jsonrpc": "2.0",
"result": "ok",
"id": 421321
}
- ryan hs mr.ryansilalahi@gmail.com
MIT License