Now dead the rest of the scandal over application is completed before starting to be the single page
front end.
We have a future.
Yes.
I thought you'd be a good idea to show you how you can already use all the services provided by the
application using postman.
Postman is a powerful and complete API development environment.
It's a professional client that you can use to communicate with and test your API.
And it's very useful especially while developing its use by more than 200000 companies and I'm pretty
sure you know more than a couple of them.
We have PayPal Coursera Shopify Adobe Twitter and so on.
One of the really great things about the rest api is and about the API first approach is that as we
said we can use the rest and points to provide access from all sorts of different clients and so before
starting to build that browser single page front end.
We are not going to use that arrest API we've postman considering that we are also allowing token authentication
if we have not used the postman so far.
During the course is just because Django framework is so amazing that it provides us the browser able
API.
So it's not strictly needed for you to learn how to use post.
However if you wish to you can click on get started and download the free version of the client.
I am currently only Linux but of course you can find all the download links for your favorite operating
system was installed open the program and you should find yourself in front of a very similar window.
We are not going to use all of Postman's functionalities.
They are really a lot and we simply don't need all of them.
You should however know the basics of its interface as you can see are we have a text input that we
can use to write down which we are real and point to to communicate with.
Then we have a drop down menu where we can select the kind of age to request that we want to perform.
Yeah we have a send button.
A save button that you can use to save all the parameters of the request for later use usage.
Then we can define several query parameters in a form like fashion let's say and we can select the type
of authorization that we want to use.
We can define the address for the request and the body.
So first of all let's create an account.
I'm going to make a post request and of course let's also grab the registration and bind them yet in
the other Elsner by file of the project.
I'm going to copy API the rest off registration and you also need of course to run the development server.
So let's go back to postman going to past this year.
And of course we also need the address of our development server.
So specifically this one
so we're going to make a post request to this and find and considering that we want to register an account.
We will have to pass some data here you can choose how you want to send your data for example form data
or maybe you need to send some binary data specifically we need to send a Jesus or a raw and yeah we
select Jason.
And yeah I'm going to paste a Jason like the one we've used in the previous lesson to register in your
account of your arrest.
So now let's press send it to actually send this post to request to our End Point the registration was
successful and we know that because you are getting back are talking and we're going to need to authenticate
all the other requests and using these token we can now make a GET request to another point of our application.
So specifically we can get a list of all the questions in our database.
We know the endpoint to be API is less questions so let's go back to postmen just going to paste these
like so and from me I'm going to copy this part of the endpoint this way.
So we want to make a GET request that we know that we need to be authorized to actually retrieve some
data from this endpoint.
So let's go to.
And yet we can write authorization India token space and we just copy and paste this token so Sandor
as you can see we have not clearly answer any questions yet.
And that's because of course we are logged in.
We have a newly created account so Excel API user just going to copy the other like so authorization.
And that is
authorization so Sander and of course love Dean as rest test.
So let's answer the first question let's make it post request.
Define Yeah there's so and.
Of course authorization it's no go to Buddy row type Jason.
And we know that we need content first.
That's where we arrest all cups so we know the end point to be closed API then questions.
Then we need of course the slug of the question that we want to answer
paste and then what is the answer.
So let's send disposed to request with discontent as Jason said.
And actually the field was called Body not content.
So send it and we have now answered the question.
So if we make another get request here we now get user s answered true.
As you can see postman is a very powerful tool and more importantly everything in the rest api is working
as expected.
Even using token authentication.
So in the next lesson we can finally start to develop the front end aspects of our application.