Previously, I used webapi to provide interfaces in the project, and found that in the project there is automatic generation of help documents according to webapi methods and comments, and you can also test webapi methods, which are very powerful, and now I will share them with you.
Take a look at the generated webapi documentation first.
1. The following figure shows the top page of the generation help document, where Values is the controller, and the list below the API shows the http method (Get, POST, etc.), the action of the request, and the description of the method.
2. Click the link in the red box to open the details page of the API method, as shown in the figure below.
3. Click Test API to open the following page
4. Enter the parameters, click the Send button, open the following page, and you can see the return value.
The steps to set it up are as follows:
Development environment VS2012 + MVC4 + WEB API
1. Reference the Web API Test Client through NuGet
Referencing the DLL will generate a file like this:
This is our help documentation interface
2. Make the following settings in the project properties, check the XMl document file, and set the path
3. Create a XmlDocument.xml under the App_Data folder of the project
4. Open the AreasHelpPageApp_StartHelpPageConfig.cs file and cancel the following code comments
Run the project, open the http://localhost:3619/Help, and you can see the automatically generated API document, which is an image of the article
Project Download: