Encode REST response with base64