JSON, out of the box.
Rocket has first-class support for JSON, right out of the box. Simply derive
Serialize to receive or return JSON, respectively.
Like other important features, JSON works through Rocket’s
FromData trait, Rocket’s approach to deriving types from body data. It works like this: specify a
data route parameter of any type that implements
FromData. A value of that type will then be created automatically from the incoming request body. Best of all, you can implement
FromData for your types!