encode the body as JSON / handle content-types
v2.2.0