JSON form encoded

From IndieWeb
Jump to: navigation, search

JSON form encoded is shorthand for offhand references to "just post JSON to the server" type expressions that appear to be used by cargo cult users of JSON and variants thereof, and has non-trivial implementation issues compared to the well-understood and well-supported plain form-encoded approach.

Lack of support

JSON does not have as wide support for POST requests compared to form-encoded requests.

In most web frameworks you have to jump through hoops to read the raw POST data if it's JSON format.

A Google search can confirm that lots of people are confused about how to handle JSON POST requests: how to receive JSON post in php, ruby, python, node

Imprecise - what MIME type

"JSON form encoded" is imprecise.

What MIME type are you supposed to use to upload? I.e. stack overflow confusion

  • application/json
  • multipart/form-data
  • or application/ld+json

See Also