官术网_书友最值得收藏!

Postman

Postman is an HTTP client that simplifies the testing of web services and RESTful APIs. Postman allows you to easily construct HTTP requests, send them, and inspect them.

Download Postman from https://www.getpostman.com/, and then install and run it:

  1. On the introduction screen, click on the Request option:

  1. Enter GetProducts in the Request name field, and then type GiveNTake into the collection section and create a new collection. Press Save to create the new request:

  1. Enter the full URL of the GetProducts API (for example, http://localhost:5267/api/products) in the URL field:

  1. Make sure that the HTTP Verb is set to GET and click on the Send button.
  2. After a few moments, you should see the response that was received from your service, and you can now inspect the status code, response body, and headers: 

You will find Postman to be an indispensable development tool while you develop your APIs, and we will use it many times as we go deeper into ASP.NET Core in this book.

At this point, you might be wondering, how come the GetProducts method was invoked when we navigated to /api/Products? To answer this question, we need to talk about how ASP.NET Core routes requests into controllers and actions.

主站蜘蛛池模板: 西青区| 呼伦贝尔市| 天门市| 枣强县| 彭阳县| 安岳县| 武陟县| 互助| 冷水江市| 河曲县| 清镇市| 通榆县| 元阳县| 涿鹿县| 商丘市| 黄大仙区| 化州市| 昌平区| 英超| 当阳市| 贞丰县| 旬阳县| 康平县| 泌阳县| 上虞市| 桦南县| 武义县| 班玛县| 保靖县| 乐亭县| 贵州省| 宝山区| 辽阳市| 五峰| 白河县| 翁源县| 额尔古纳市| 宽甸| 常宁市| 乌鲁木齐县| 林口县|