jjzjj

Invoke-WebRequest

全部标签

asp.net - 如何使用来自 asp.net 的 webrequest 将 xml 发送到 asp 页面?

我想从asp.net页面将xml文档发布到asp页面。如果我将WebRequest与内容/类型文本/xml一起使用,则文档永远不会到达asp页面。我该怎么做? 最佳答案 这是一个没有任何错误处理的示例(自己动手:)):HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create(targetUri);stringsendString=formParameterName+"="+HttpUtility.UrlEncode(xmlData);byte[]byteStream;byteSt

带有 WebRequest 的 C# 多线程程序

首先我是论坛的新人所以请对我和我的英语有点耐心。:-)我正在编写一个C#应用程序,它应该将多线程SOAP请求发送到apache后端。到目前为止一切正常,但我遇到了问题。应用程序首先读取一个XML文件来自另一个系统,首先被解析为类,排序并发送到SOAP后端。这里是片段ListThreadsPerOneRecord=newList();boolExecuteSingleThreaded=false;//Thevariablelistispassedasparametertothefunctionforeach(Recordprovinlist){XMLResult.AppendText("

xml - 使用 invoke-command 时如何将 xml 元素传递给 scriptBlock

使用PowerShell3.0,我使用Invoke-Commandcmdlet将xmlElement传递到脚本block。问题是我认为scriptBlock正在接收作为arrayList而不是xmlElement的参数(实际上,当我注销$service.GetType时,我知道接收到的参数是ArrayList()).这是我的XMLElement:SpoolerDisabled这是我的脚本block:$scptModifyService={param($service);Set-Service-Name$service.ServiceName-StartupType$service.St

xml - Powershell invoke-webrequest with xml soap envelope body containing £ char 错误

我正在尝试使用PowershellsInvoke-Webrequest将soap信封发送到受密码保护的Web服务。密码包含“£”字符,这会导致以下错误:Invoke-WebRequest...Theformatterthrewanexceptionwhiletryingtodeserializethemessage:Therewasanerrorwhiletryingtodeserializeparameterhttp://tempuri.org/:password.TheInnerExceptionmessagewas'Therewasanerrordeserializingtheo

xml - 从 WebRequest 模拟 WebResponse

我终于开始着手创建一些可与RESTfulWeb界面一起使用的应用程序,但是,我担心每次按下F5键运行一系列测试时我都在敲打他们的服务器。基本上,我需要获得一系列网络响应,这样我才能测试我是否正确解析了不同的响应,而不是每次都访问他们的服务器,我想我可以这样做一次,保存XML,然后在本地工作。但是,我不知道如何“模拟”WebResponse,因为(据我所知)它们只能由WebRequest.GetResponse实例化你们是怎么mock这种事情的?你?我真的不喜欢我正在攻击他们的服务器这一事实:S我不想太多更改代码,但我希望有一种优雅的方式来做到这一点..接受后更新Will的回答是我需要的

windows - 调用包含变量的 webrequest -body

早上好,stackoverflow的人们,我有一个Google无法帮助我解决的问题。我们有一个API,我们使用以下代码对其进行身份验证:$DeviceNumber=Read-Host"Enterdevicenumber"$URL="https://URL.diskspace.website.com/v1/"$pass='password123'$postParam='{"password":"$pass"}'$AuthToken=""#LogintotheURL$IWRLogin=Invoke-WebRequest-MethodPost-Uri$URL/login/$env:usern

node.js - 使用 PowerShell Invoke-Command and Process 让标准输出出现在控制台上

我有一个使用Invoke-Command的Powershell脚本。这是被调用的代码:$scriptblock={$process=New-Objectsystem.Diagnostics.Process$si=New-ObjectSystem.Diagnostics.ProcessStartInfo$si.FileName=$cmd$si.Arguments=$cmd_args$si.UseShellExecute=false$si.RedirectStandardOutput=true$process.StartInfo=$si$process.Start()$processId=

windows - 使用 powershell Invoke-AddCertToKeyVault 命令创建 Azure 自签名证书

最近,我尝试按照微软的手册为AzureServiceFactory创建自签名证书:AzureDocs:SecureaServiceFabriccluster,step2.5,02/05/2016但是命令Invoke-AddCertToKeyVault失败并出现下一个错误:Invoke-AddCertToKeyVault:Theterm'Invoke-AddCertToKeyVault'isnotrecognizedasthenameofacmdlet,function,scriptfile,oroperableprogram.Checkthespellingofthename,orif

windows - 在文件名中使用通配符的 Invoke-WebRequest -OutFile <filename>

如何在Invoke-WebRequest的-OutFile参数中引用通配符?$filename="Image[1].jpg"$uri=[System.Uri]"http:/url/to/image.jpg"Invoke-WebRequest-Uri$uri-OutFile$filename这段代码给了我一个异常(exception):CannotperformoperationbecausethewildcardpathImage[1].jpgdidnotresolvetoafile.Technet说Twothingstonotehere.First,weenclosedthepath

windows - Powershell Invoke-WebRequest 一直很慢。我怎样才能解决这个问题?

我有一台全新的联想Yoga笔记本电脑,装有Windows10专业版。我注意到Chocolatey在下载和安装本应快速安装的软件时似乎真的非常慢。这让我怀疑Powershell存在问题,无论是PS本身还是这台笔记本电脑的某些方面,我都无法对其进行故障排除。简而言之,curl/Invoke-WebRequest始终需要大约43秒。PSC:\WINDOWS\system32>Measure-Command{curlhttps://microsoft.com}Days:0Hours:0Minutes:0Seconds:43Milliseconds:316Ticks:433164486Total