简体   繁体   English

如何通过命令行调用asp.net Web应用程序?

[英]How to call an asp.net web application via command line?

We have an internal asp.net web application which users can configure and execute automated tests. 我们有一个内部的asp.net Web应用程序,用户可以配置和执行自动测试。 I'd like to be able to launch tests with is application but from a remote command line console or other non browser way. 我希望能够使用is应用程序启动测试,但是可以通过远程命令行控制台或其他非浏览器方式启动测试。 The goal is to be able to launch tests without user interaction. 目标是无需用户交互即可启动测试。 Any ideas how to do this without a high impact on the existing solution? 有什么想法在不影响现有解决方案的前提下如何做到这一点? Thanks in advance, John 预先感谢,约翰

The solution to my problem was Web API. 我的问题的解决方案是Web API。 I found a way to do exactly what I wanted by adding a few simple files to the asp.net application and then calling it using PowerShell's Invoke-RestMethod. 通过向asp.net应用程序中添加一些简单文件,然后使用PowerShell的Invoke-RestMethod对其进行调用,我找到了一种完全实现所需功能的方法。 Details of setting up the Web API: http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/using-web-api-with-aspnet-web-forms Details of using Invoke-RestMethod: http://csharpening.net/?p=1613 John 设置Web API的详细信息: http : //www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/using-web-api-with-aspnet-web-forms详细信息Invoke-RestMethod的方法: http ://csharpening.net/?p=1613 John

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM