http - 从 Windows Powershell 发送 HTTP 请求的最佳方式是什么?

标签 http networking powershell

从 Windows Powershell 发送 HTTP 请求的最佳方式是什么?

最佳答案

找到一种方法:

$page = (New-Object System.Net.WebClient).DownloadString("http://localhost/")

感谢 Steven Murawski 的评论:

The best way really depends on what task you are trying to accomplish as the two answers below have noted. WebClient is the simplest, but HttpWebRequest is the most flexible.

关于http - 从 Windows Powershell 发送 HTTP 请求的最佳方式是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/340553/

相关文章:

python - 如何设置 session 在 4 分钟内过期?

linux - 流量转发

Java http cookie

java - 如何使用 Java.sql.Connection.setNetworkTimeout?

Powershell 获得笔记本品牌

c# - 我应该将完整的 URL 还是仅将域传递给 ServicePointManager.FindServicePoint()?

ruby-on-rails - 从私有(private) NIC 访问时,Rails 显示 IP 为 127.0.0.1,但 Nginx 显示正确的 IP。公共(public) IP 可以正常转发

java - 无法注册到文本安全服务器工作

PowerShell 脚本 - Get-ChildItem

sql-server - 在 Powershell 中将 SQL 查询作为数组返回