The video for this lesson is currently being updated, please read the transcript instead.

Using AJAX in Vue

Now that we understand how the API works, let's now go ahead and make an AJAX call to retrieve some proper poster objects.

GET request

In the onSubmit function, we're now going to use the Fetch API to make a GET request to the API.

So let's delete the console log and instead call fetch. The first argument to is the resource we want to query which will be "/search".

However, you'll recall that we need to supply a query to this endpoint as well. So let's make it "/search?q=".

To view the complete lesson you'll need to login or join this course.


Click to load comments...