Responder Web Framework Mini-course Transcripts
Chapter: Consuming the API with Vue.js
Lecture: Calling our RESTful service

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now before we talk about Vue.js properly
0:02 at least to quickly introduce the application
0:05 that I'm going to let you have to play with
0:07 the API that we'll be building here
0:08 let's just talk about some ways we can call our API.
0:12 Now, in the beginning, we just clicked on it in PyCharm
0:15 or opened a browser and typed in the address
0:17 and we just went there.
0:18 And that's kind of okay for get requests sometimes
0:21 unless you need to modify the header
0:23 but it's really hard to test post
0:25 and other types of verbs that way
0:26 so let me show you something better.
0:28 Let's start by actually just getting our app
0:30 to run again over here.
0:31 So this is a fresh copy we're going to work with
0:34 so let's go over here and go to that directory
0:37 and we're going to create a virtual environment
0:39 by running python3 -m venv venv.
0:42 Activate it and upgrade pip
0:44 'cause pip is always out of date
0:45 for virtual environments, it seems like.
0:47 So with that in place
0:49 we can come over here and open this in PyCharm.
0:54 All right, super. That's all loaded up.
0:56 Let's go in here and let's mark this directory.
1:01 That's a sources route
1:02 and we don't really have to mess with that.
1:03 That's just HTML and JavaScript, but I guess it won't hurt.
1:08 And mark it as a resource route
1:10 so it doesn't think things like ../jsfile
1:13 or whatever are missing.
1:15 Okay, so, also make sure that we have
1:17 the right thing running.
1:18 Yes, our virtual environment is there
1:20 so let's go into MovieDb Service.
1:25 Install our requirements, so this will run.
1:29 Great, looks like that worked.
1:31 Let's just go run our app.
1:32 We might need to change the directory
1:34 and wait for this to finish, this indexing.
1:37 All right, let's go and run that, see how this works.
1:39 Click on this. All right, beautiful.
1:42 It looks like our service is up and running here.
1:44 You've seen this from before.
1:46 So if we click here, we can test our little run
1:48 but let's try something besides just calling it a browser.
1:51 Let's go open Postman.
1:52 You can go and search for Postman in this app.
1:55 It's really nice, it's free.
1:57 Come over here and we can enter the URL
2:00 and send it and here we get, you can see a nice output.
2:03 We can, of course, tweak the body
2:06 make this a POST or PUT or something like that.
2:08 So if you want to explore and interact with the service
2:11 and test it a little bit better than with your browser
2:13 I recommend using Postman for that.
2:16 Of course, it's not an app, it's not as much fun
2:18 but it is a good way to explore your API
2:20 as you're building it.