jsonrpc
1 client
jsonrpc-send!
2 server
jsonrpc-start
8.2

jsonrpc

Lîm Tsú-thuàn

 (require jsonrpc) package: jsonrpc

1 client

syntax

(jsonrpc-send! url jsexpr)

 
  url : string?
  jsexpr : jsexpr?
Example

(jsonrpc-send!
 "http://localhost:4389/jsonrpc"
 (hasheq 'jsonrpc "2.0"
         'id "0"
         'method "initialize"
         'params (hasheq 'processId 0
                         'rootUri "file://Users/linzizhuan/dannypsnl/jsonrpc"
                         'capabilities (hasheq 'hoverProvider #t
                                               'definitionProvider #t
                                               'documentSymbolProvider #t
                                               'documentLinkProvider #t
                                               'documentFormattingProvider #t
                                               'documentRangeFormattingProvider #t))))

2 server

syntax

(jsonrpc-start user-handler)

 
  user-handler : (-> string? jsexpr? void?)
Example

(define (user-handler method params)
  method)
 
(serve/servlet
 (jsonrpc-start user-handler)
 #:port 4389
 #:launch-browser? #f
 #:servlet-path "/jsonrpc")