How to send files to Drupal 8 via REST
Apply patch to the core: https://www.drupal.org/node/1927648
Install Rest UI using: drush dl restui-8.x-1.x
Go to /admin/config/services/rest and activate File /entity/file/{file}
Under /admin/people/permissions set all necessary permissions
Make sure files folder exists and has proper permissions
Encode image using command tool base64
POST to drupal.url/entity/file/

{"_links":
{
  "type":{"href":"http://drupal.url/rest/type/file/file"}
},
  "filename":[{"value":"input.jpg"}],
  "filemime":[{"value":"image/jpeg"}],
  "data":[{"value":"insert-output-from-base64-here"}] }