The parameter binaryReference has a very sparse and confusing description:
https://developer.enonic.com/docs/xp/stable/api/lib-node#getbinary
In my mental model, the binaryReference param is exactly the same parameter as the name param in the corresponding getAttachmentStream() method in lib-content:
https://developer.enonic.com/docs/xp/stable/api/lib-content#getattachmentstream
…just that it's named differently between the two libraries. It would clean up some confusion if at least the descriptions matched in the documentation for both these methods, so people understand that they work in the same way.
Also, the doc for both of these methods could do well with some explanation of what exactly a stream is, and examples for when you'd use it (i.e. when you want to fill a response body with the contents of a file)
The parameter
binaryReferencehas a very sparse and confusing description:https://developer.enonic.com/docs/xp/stable/api/lib-node#getbinary
In my mental model, the
binaryReferenceparam is exactly the same parameter as thenameparam in the correspondinggetAttachmentStream()method in lib-content:https://developer.enonic.com/docs/xp/stable/api/lib-content#getattachmentstream
…just that it's named differently between the two libraries. It would clean up some confusion if at least the descriptions matched in the documentation for both these methods, so people understand that they work in the same way.
Also, the doc for both of these methods could do well with some explanation of what exactly a stream is, and examples for when you'd use it (i.e. when you want to fill a response body with the contents of a file)