gpt4 book ai didi

asp.net - 使用 VB.NET 发送 HTTP 命令

转载 作者:行者123 更新时间:2023-12-03 23:35:00 25 4
gpt4 key购买 nike

我正在尝试使用 VB.NET 发送 HTTP 命令,但我不太确定该怎么做。我不想实际导航到页面,只是执行命令。

http://xbmc.local/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary%28video%29

我正在做的是为我的 XBMC 家庭影院和我的家庭自动化构建一个集成界面。

最佳答案

您可以使用 WebRequest 对象发送 HTTP 请求。

' Create a WebRequest object with the specified url. ' 
Dim myWebRequest As WebRequest = WebRequest.Create(url)

' Send the WebRequest and wait for response. '
Dim myWebResponse As WebResponse = myWebRequest.GetResponse()

WebResponse类有许多属性,您可以检查请求是否成功。还有一点需要注意, GetResponse()如果超时会抛出异常。

关于asp.net - 使用 VB.NET 发送 HTTP 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2299599/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com