Or just pay attention to the HTTP Accept header and the HTTP Content-Type header. Doing so allows you to support XML, JSON, gRPC, and any other type of input, and put the result out in any other format.
For example, a user could call with:
Content-Type: application/grpc
and
Accept: application/json
to send data in gRPC, and receive a response back in JSON.
This could also be done with a different Content-Type
header:
Content-Type: x-application/opennurbs-chunk
or something