Skip to content

Instantly share code, notes, and snippets.

View jjlorenzo's full-sized avatar

jjlorenzo jjlorenzo

  • Valencia, Spain
View GitHub Profile

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",