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

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.

主站蜘蛛池模板: 砚山县| 陕西省| 齐齐哈尔市| 稷山县| 河北区| 申扎县| 年辖:市辖区| 淳安县| 顺平县| 白朗县| 宜昌市| 临夏县| 南宁市| 洮南市| 绵阳市| 苏尼特右旗| 柯坪县| 南漳县| 梁平县| 磐石市| 黑龙江省| 兴义市| 中西区| 唐河县| 麟游县| 汾阳市| 武功县| 通海县| 若尔盖县| 泽库县| 石门县| 新野县| 大连市| 大城县| 巩留县| 古蔺县| 临泉县| 江都市| 巨鹿县| 石屏县| 泰州市|