Set JSON-related properties only if the Content-Type is 'application/json'