Forum Discussion
Hi Tim,
The REST GET is setup with response type BINARY which puts the BASE64 encoded data into the entity field with a “_snaptype_binary_base64”, which I can’t decode directly with the Base64.decodeAsBinary($entity) function.
However, if I BASE64 decode it with the Document-To-Binary snap and then re-BASE64 encode it with the Binary-To-Document snap, I end up with the same BASE64 data in a content field, without any “_snaptype_binary_base64”, which then decodes fine with the Base64.decodeAsBinary($content) function.
- tstack7 years agoFormer Employee
Sorry, for the confusion, but I think the data is already binary (a byte array internally). The “_snaptype_binary_base64” is how the byte array is stored as JSON for preview. Have you tried just using
$entity
in the REST POST snap?