Manual Testing with Postman

If you are a developer, tester, or a manager, sometimes understanding various methods of API can be a challenge when building and consuming the application.
Generating good documentation and help pages for your Web API using Postman with .NET Core is as easy as making some HTTP calls.
Let’s start downloading simple To-do projects from GitHub.
- Download and run the below TodoMvcSolution from this link.

- Download Postman
Postman is a Google Chrome application for testing API calls. You can download and install Postman from below web site.
Here are the APIs we can test - Get, Post, Put and Delete for this application.
Here are the Web APIs we want to test.
//Copyright 2017 (c) SmartIT. All rights reserved.
//By John Kocer
// This file is for Swagger test, this application does not use this file
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using SmartIT.Employee.MockDB;
namespace TodoAngular.Ui.Controllers
{
[Produces("application/json")]
[Route("api/Todo")]
public class TodoApiController : Controller
{
TodoRepository _todoRepository = new TodoRepository();
[Route("~/api/GetAllTodos")]
[HttpGet]
public IEnumerable<SmartIT.Employee.MockDB.Todo> GetAllTodos()
{
return _todoRepository.GetAll();
}
[Route("~/api/AddTodo")]
[HttpPost]
public SmartIT.Employee.MockDB.Todo AddTodo([FromBody]SmartIT.Employee.MockDB.Todo item)
{
return _todoRepository.Add(item);
}
[Route("~/api/UpdateTodo")]
[HttpPut]
public SmartIT.Employee.MockDB.Todo UpdateTodo([FromBody]SmartIT.Employee.MockDB.Todo item)
{
return _todoRepository.Update(item);
}
[Route("~/api/DeleteTodo/{id}")]
[HttpDelete]
public void Delete(int id)
{
var findTodo = _todoRepository.FindById(id);
if (findTodo != null)
_todoRepository.Delete(findTodo);
}
}
}
Note - Your local port number may be different than mine. Use your local port number.
http://localhost:63274/api/GetAllTodos // GET
http://localhost:63274/api/AddTodo //POST
http://localhost:63274/api/UpdateTodo //PUT
http://localhost:63274/api/DeleteTodo/5 // DELETE
Testing GET with Postman
- Testing GET is very easy. First, we need to set HTTP Action from the drop-down list as GET.
- Then, we need to type or paste into the API URL box.
- Then, click the blue SEND button.





Abhay TiwariPosted Mar 14, 2024, 6:27 AM
Very Nice and Useful. Thanks
Eric ZbrunPosted Apr 25, 2019, 3:29 PM
Hi!! I have one problem, I can't insert data, i tried with http://localhost:63274/api/AddTodo { "id": 0, "name": "ASP.NET Core 2.2" } in Postman (V. 7.0.06) and this isn't working. I used VS2019. Can you help me?
Bhavesh JadavPosted Oct 9, 2018, 11:39 PM
Nice.......