The example below uses cURL to upload image file included as a binary file.
curl -i --upload-file /path/to/image.png --header \"Authorization: Token\" \'http
I think the curl command
curl -i --upload-file /path/to/image.png --header "Authorization: Token" 'https://url....'
uses PUT while your Java client uses POST
Source: The man page of curl.
-T, --upload-file
This transfers the specified local file to the remote URL. If
there is no file part in the specified URL, Curl will append the
local file name. NOTE that you must use a trailing / on the last
directory to really prove to Curl that there is no file name or
curl will think that your last directory name is the remote file
name to use. That will most likely cause the upload operation to
fail. If this is used on an HTTP(S) server, the PUT command will
be used.
Not sure if this is the actual problem though. Your API doc link actually specifies POST.