sequenceDiagram
note over C: MessagePack discovery phase
C->>S: POST: CT:application/json, Accept:application/msgpack,application/json, body=JSON
S->>C: 201: CT=application/msgpack, body=msgpack
note over C: MessagePack is known to be supported
C->>S: PUT: CT:application/msgpack, Accept:application/msgpack,application/json, body=msgpack
S->>C: 200: CT=application/msgpack, body=msgpack
MessagePack (a.k.a. msgpack) is a great data interchange format. It is often cited as binary JSON. Flexible like JSON, but more efficient. Not as snappy as Protocol Buffers/gRPC, but more flexible and still fast.
The aim of this enhancement:
Acceptheader indicating the server that the client supports msgpack, ifclient.MsgPack(true)was called.application/msgpack.application/msgpack.Acceptheader indicates support. Otherwise use JSON.Go standard JSON library uses "json" tagging. The msgpack package chosen must be able to use that tagging for smooth interworking.