jjzjj

invoke-webrequest

全部标签

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

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

c# - 加快 WebRequests 的方法?

这个问题在这里已经有了答案:HowtoperformafastwebrequestinC#(4个答案)关闭6年前。我制作了一个可以访问和控制Onvif摄像头的应用程序,它做得很好。然而,这是我第一次制作任何使用这样(或根本没有)网络请求的应用程序,所以我假设我可能使用的是非常基本的技术。我很好奇的代码部分是这样的:Uriuri=newUri(String.Format("http://"+ipAddr+"/onvif/"+"{0}",Service));WebRequestrequest=WebRequest.Create((uri));request.Method="POST";by

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

windows - wininet API 的 P/Invoke 机制

我正在使用wininetapi将HTTPPOST发送到SSL服务器。我想使用P/Invoke将这些api包装到C#,因为C#中的原始代码。我如何将这些api包装到c#。我试过了,但没有用。我正在为WindowsMobile和智能手机做这个。LPCTSTRlpszAgent=_T("CeHttp");DWORDdwError;DWORDsizeInResult,sizeOutResult,sizeToWrite,sizeWritten,dwRead;HINTERNEThInternet=NULL;HINTERNEThConnect=NULL;HINTERNEThRequest=NULL;

c# - 正确使用 P/Invoke

我需要从C#调用外部dll。这是header定义:enumWatchMode{WATCH_MODE_SYSTEM=0,WATCH_MODE_APPLICATION=1};LONGADS_APIWDT_GetMode(LONGi_hHandle,WatchMode*o_pWatchMode);我在C#中添加了枚举和调用:publicenumWatchMode{WATCH_MODE_SYSTEM=0,WATCH_MODE_APPLICATION=1}[DllImport("AdsWatchdog.dll")]internalstaticexternlongWDT_GetMode(longh