One Page App With Drupal 8 and Vue.js - Part 10 - Creating Movie With Vue.js

Jan 11, 2016

In this tutorial you will learn how to connect to the Drupal 8 REST API and create a new movie node using Vue.js and Vue resource plugin.

As you can imagine creating a new Drupal node via REST API is not as easy as getting the list of nodes or one node. Mostly because to create a new node via REST API you need to take care of Drupal authorization first. You don't want unauthorized users to add content to your site as they please.

But as you will see, if you are using Vue.js and its resource plugin to make your requests to the Drupals API creating a new node via REST is very easy if you know what you are doing.

In this episode we are going to create a form that will let us enter title and body of our movie node. Then we are going to post the data that we get from that form to Drupal and create a new movie node.

I'm also going to show you how to inform a user of successful post request to the Drupl 8 REST API.

### Code used in this tutorial

[Download it here](…)…

Hi! I'm Karim Boudjema, the developer and site-builder of this site. I'm currently working as a freelance Drupal developer.

I was wondering how could I giving back to the Drupal community all what it gave to me during the last 10 years, that's how the idea of this site came to me ... (read more)

Hi! I’m Santiago Rico, the web designer and themer of this site.

When Karim proposed me to design and theme this site for the Drupal community, I accepted immediately because the community is the main reason why I love Drupal so much.