- 新建WebAPI空工程
- 选择模板
- 升级nuget包
- 添加控制器
- 添加测试方法
1 [HttpGet] 2 public string Hello() 3 { 4 return "hello,world"; 5 }
- 使用浏览器访问
- 说明:注意浏览器中的路径 http://localhost:25966/api/Swagger/Hello
使用:api+ SwaggerController类+方法名 来访问。
1 [HttpGet] 2 public string Hello() 3 { 4 return "hello,world"; 5 }
使用:api+ SwaggerController类+方法名 来访问。
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。