Hi,
what is the best practice to handle incoming attachment of a REST service?
We would like to have a REST service capable of accepting attachment/file, storing this file and processing it, resulting in a kind of response.
How can this be handled?
One of the possibilities is to have an incoming file encoded in base64 and added into a REST Request as a Header, then parsing the Headers for parameter, retrieving the value of this parameter, decoding the file and storing/using it.
Is there a way of accessing attachments of a REST service? If yes, can you provide a java code/example for it?
An attachment for a REST service? Never heard about that! The only way is to send the attachment and all other parameters as form parameter and configure the tRESRequest to accept formula data. The parameter containing the attachment should be configured as byte[].
One standard conform way to send binary data is to convert the data into a Base64 string and send this string as json value.