Add test page to Webapi's Rest Interface Service (i)

Source: Internet
Author: User

When using WEBAPI to provide rest services, a common operation is to test the interface. The ASP. NET Webapi framework itself does not provide this interface, but because it provides a standard rest service, it is very convenient to use some third-party tools.

I used to test with Chrome's postman plugin, which can be used to simulate various HTTP request operations. Although this tool is also good, but because it is a common tool, when using it to build HTTP headers, and according to the specific API to assemble the message body, this is a more troublesome thing.

Today, when I was hanging out on the internet, I found a more useful test tool, Swagger-ui, which provides a very friendly test interface for the rest interface:

Not only can you provide a list of interfaces, but also read the parameters list of the interface and provide a friendly configuration interface:

Interface description, parameter description, parameter types can all come out, very friendly, even the parameters of the various fields of the comments can be marked out, is basically a very friendly help document.

More examples can refer to its official demo:http://petstore.swagger.io/. Using it to test is very simple, directly input parameters on the line, without the laborious construction of various URLs and messages, more convenient than postman.

Due to space limitations, this article is only a few simple introductions to Swagger-ui, and the next article details how to integrate Swagger-ui into WEBAPI.

Add test page to Webapi's Rest Interface Service (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.