Share with
How to test python django rest api using postman software- Part 4
Here we are tesing some sample django rest api using postman software. We are test CRUD operation by using postman api tester.
Postman
The Collaboration Platform for API Development
Postman is powerful tool for testing rest or web api repeatable for assuring the api is created working perfect.
To download postman click here.
We are already having django rest framework movie collection project. If you do not check previous parts please check it once you dont have api.
click here for part 1
click here for part 2
click here for part 3
In part 3 having movie collection project crud api now we are testing this crud operation using postman.
Create/Post request method
Add Movie under the movie table set POST method and add this url http://127.0.0.1:8000/movies/ and set headers like Key= Content-Type & value= application/json under the Body use raw data and add this content
{ "title":"Ek tha tiger", "desc":"Salman khan movie", "year":"2012" }
and send the form to check result.
Get request method
Set GET method and add this url http://127.0.0.1:8000/movies/ and send to check the results
GET by ID request method
Set GET method and add this url http://127.0.0.1:8000/movies/1 and send to check the results
PUT request method
For update perticular object set PUT method and add this url http://127.0.0.1:8000/movies/1/ and set headers like Key= Content-Type & value= application/json under the Body use raw data and add this content
{ "title":"Tiger zinda hai", "desc":"Salman khan movie", "year":"2012" }
and send the form to check result.
DELETE request by ID
Set DELETE method and add this url http://127.0.0.1:8000/movies/1/ and send to check the results
Leave a reply

Sign in to stay updated on your professional world.
Pro Code Programming
Share and learn to code!
Programming articles, which helps you to build your application.
If something you are stuck to code and complete the program, just find here your quetion related articles.
New to Pro Code Programming?