Running Drupal 8.1.2 and have followed the drupal.org REST tutorial for Drupal 8. I can now read and create new basic page and custom node records via REST calls.

Would someone please post a working example that demonstrates how to POST a new node record that populates an image field?

I've found a couple of examples that talk about uploading a file by base64 encoding it and POSTing a request to .../entity/file but all attempts to do this with Drupal 8.1.2 result in a 500 error response. If that is the correct first step to populating an image field, then a working example of how to post a file and then how to "attach" it to a node would be great.



postporncig’s picture

This is going to be in drupal 8.2
#1927648: Serialize file content (base64) to support REST GET/POST/PATCH on file entity

Meanwhile you can use RestUi and File Entity to achieve this

Read more here : http://drupal.stackexchange.com/questions/118106/how-to-send-files-to-drupal-8-via-rest

^ Read last post not accepted one !