This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
279 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
POST http://localhost:8000/ | ||
Content-Type: application/json | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "multiply", | ||
"params": { | ||
"a": 2, | ||
"b": 3 | ||
}, | ||
"id": 1 | ||
} | ||
|
||
|
||
date: Sat, 21 May 2022 16:53:31 GMT | ||
content-length: 36 | ||
content-type: text/plain; charset=utf-8 | ||
connection: close | ||
|
||
HTTP/1.1 200 - OK | ||
date: Sat, 21 May 2022 16:53:31 GMT | ||
content-length: 36 | ||
content-type: text/plain; charset=utf-8 | ||
connection: close | ||
|
||
|
||
### | ||
POST http://localhost:8000/ | ||
Content-Type: application/json | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "divide", | ||
"params": { | ||
"a": 10, | ||
"b": 3 | ||
}, | ||
"id": 2 | ||
} | ||
|
||
|
||
date: Sat, 21 May 2022 16:53:51 GMT | ||
content-length: 52 | ||
content-type: text/plain; charset=utf-8 | ||
connection: close | ||
|
||
HTTP/1.1 200 - OK | ||
date: Sat, 21 May 2022 16:53:51 GMT | ||
content-length: 52 | ||
content-type: text/plain; charset=utf-8 | ||
connection: close | ||
|
||
|
||
### Batch request | ||
POST http://localhost:8000/ | ||
Content-Type: application/json | ||
{ "jsonrpc": "2.0", "method": "multiply", "params": { "a": 2, "b": 3 }, "id": 10 } | ||
{"jsonrpc": "2.0", "method": "sum", "params": [1,2,4], "id": "1"} | ||
{"jsonrpc": "2.0", "method": "notify_hello", "params": [7]} | ||
{"jsonrpc": "2.0", "method": "subtract", "params": [42,23], "id": "2"} | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "divide", | ||
"params": { | ||
"a": 10, | ||
"b": 3 | ||
}, | ||
"id": "divide" | ||
} | ||
{"foo": "boo"} | ||
{"jsonrpc": "2.0", "method": "foo.get", "params": {"name": "myself"}, "id": "5"} | ||
{"jsonrpc": "2.0", "method": "get_data", "id": "9"} | ||
|
||
|
||
date: Sat, 21 May 2022 17:18:17 GMT | ||
content-type: text/plain; charset=utf-8 | ||
connection: close | ||
transfer-encoding: chunked | ||
|
||
HTTP/1.1 200 - OK | ||
date: Sat, 21 May 2022 17:18:17 GMT | ||
content-type: text/plain; charset=utf-8 | ||
connection: close | ||
transfer-encoding: chunked |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module go.neonxp.dev/jsonrpc2 | ||
|
||
go 1.18 | ||
|
||
require golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4= | ||
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.