我的https POST请求在UNIX和python上使用curl,使用以下命令:
p=subprocess.Popen(['curl','-s','-k','-X','POST', '-H','Content-Type: application/json','-d',message,<https link>],stdout=subprocess.PIPE)
它可以向web服务器发送任何字符串。现在,我希望在Windows上也能使用powershell。我做了以下工作:
^{pr2}$但是,它失败了:
Exception calling "UploadString" with "2" argument(s): "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."
At line:1 char:24
+ $webclient.UploadString <<<< ("https://host/message","strng in json format");
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
我有什么遗漏吗?任何帮助都将不胜感激。在
提前谢谢!在
乔伊
你试过调用RestMethod吗?在
相关问题 更多 >
编程相关推荐