You are doing JSON APIs wrong. When you use JSON to call an API - not a REST API, but something like JSON-RPC - you will usually want to encode one of several possible messages. Your request body looks like this: { "type": "MessageWithA",