JSON Mapping
This recipe will help you to setup a basic JSON Mapping in your application.
First you need an amber project generated with Amber CLI or from scratch.
JSON requests are automatically parsed into the params
macro when the accept
header is present and with application/json
You can use this in combination with the respond_with
helper. Here you don't need to setup content_type
, however, the requested path requires a .json
extension, by example /json_mapping.json
Also see Response With and Response & Request.
Last updated