In this blog, I am going to explain the testing technique of Web Services, Web API, MVC controller, using Postman.
Postman is open source, free to install in your system and is used to test Web API. Using Postman, you can test any type of Services, controller, or Web Application after setting your configuration.
Now, Postman can be added on only Chrome, Window and MAC. Latest version of Postman is 4.4.3
Features of Postman
- Web API
- Web Services
- WCF Services
- Rest & Soap based Services
- Mvc Controller
- Web Application
- HTTP & HTTPS based Services.
- Proxy based Services.
- Authentication & Authorize based Services.
- Form Data input.
Using the steps, given below, you can use Postman to test any type of Web URL.
Open Google Chrome Browser=>Settings=>Extensions=>Get more extension=>Type Postman in search textbox, which is given left top corner. See the image, given below:
According this screen, I have already added Postman in the Browser, but you search and click the add button thereafter installed in your system. You can see Postman tool in Chrome extension. Open Postman and you can see the screen, which is given in the next step.
There will be many methods to select e.g GET,POST,PUT,DELETE.etc. You will select according to the Service request type. See the image, given below:
You can create and save your request details in the collection, according to your project. You can also check the previous history of the request, which did not respond with all the configuration.
After selecting your request method, you'll set the request header type, UserToken (if any). See the image, given below:
In this screen, you had seen: Authorization:-
In this panel, you can set if your Application is following any type of an authentication.
Body:-This panel will not enable, when you use GET method.
You can upload an image and send to the Server.
raw:- In this, you'll set your request parameter in formats like JSON, XML,text etc..
Configure all the configurations, according your Service requirement like this and click Send.You will see the output given below. See the image, given below:
You can select your response type. In this example, I am consuming a Web API to get a response in JSON format,
using a single parameter.