I can't find a way to send binary file jpg with json Rest. The last one that I tried is with Base64.encodeToString(byte[] array, Base64.DEFAULT) and I expected in the server side with Base64.getDecoder().decode(String)... yet no results. I have seen many posts, but nothing has helped. Can you suggest me any way or library.
I am using java with Eclipse. In the client side I use android.util.Base64 library, while in server side I use java.util.Base64.
The error that show me is this:
Unexpected padding character ('=') as character #4 of 4-char base64 unit: padding only legal as 3rd or 4th character; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type byte[] from String