One operation in two JSON bindings
Two rows, SendMessage and GetTask, each headed by its gRPC rpc line from a2a.proto. In each row the left column shows the JSON-RPC request, a POST to /a2a/jsonrpc whose body names the method and carries the request message in params, and a reply whose result holds the response message. The right column shows HTTP+JSON, where the verb and path name the operation, the body or the path and query carry the request, and the reply body is the response message itself. The steps appear in capture order: each request, then its reply.
A · JSON-RPC
B · HTTP+JSON
gRPC
rpc SendMessage(SendMessageRequest) returns (SendMessageResponse)
gRPC
rpc GetTask(GetTaskRequest) returns (Task)
POST /a2a/jsonrpc
Content-Type: application/json
"jsonrpc": "2.0", "id": 1,
"method": "SendMessage",
"params":
SendMessageRequest
HTTP/1.1 200 OK
"jsonrpc": "2.0", "id": 1,
"result":
SendMessageResponse
POST /a2a/rest/message:send
Content-Type: application/a2a+json
body:
SendMessageRequest
HTTP/1.1 200 OK
Content-Type: application/a2a+json
body:
SendMessageResponse
POST /a2a/jsonrpc
"jsonrpc": "2.0", "id": 3,
"method": "GetTask",
"params": {"id": "d0c28826",
"historyLength": 0}
HTTP/1.1 200 OK
"jsonrpc": "2.0", "id": 3,
"result":
Task
GET /a2a/rest/tasks/bbfb9ea5
?historyLength=0
no body: the path and query carry the request
HTTP/1.1 200 OK
Content-Type: application/a2a+json
body:
Task