全,
我正在尝试通过PowerShell访问restful API。该应用程序接口需要几个非标准的头文件,因此我使用$request.Headers.Add()语法。
我收到一个(500)内部服务器错误,所以我知道我离成功还差得远。
我无法使用WireShark,因为终结点是Https。
如何在PowerShell中构建HttpWebRequest对象并查看原始XML?
下面是简单的代码:
$concat = EncodeBase64("$($username)@$($org):$($password)")
$request = [System.Net.HttpWebRequest]::Create($URL);
$request.Method = "POST";
$request.ContentType = "application/vnd.vmware.vcloud.session+xml;version1.5";
$request.Headers.Add("x-vcloud-authorization", $concat);谢谢!
发布于 2012-09-12 23:06:51
去叫上Fiddler和read up on how to use it to view https traffic。
https://stackoverflow.com/questions/12390246
复制相似问题