这是一个相当大的主题,但最简单的你可以试试这个......
Imports System.Net
进而...
Dim wHeader As WebHeaderCollection = New WebHeaderCollection()
wHeader.Clear()
wHeader.Add("Authorization: Bearer 0da6cf0d-848c-4266-9b47-cd32a6151b1f")
wHeader.Add("Assume-User: john.doe%40smartsheet.com")
Dim sUrl As String = "https://api.smartsheet.com/1.0/sheets"
Dim wRequest As HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create(sUrl), HttpWebRequest)
'wRequest.ContentType = "application/json" ' I don't know what your content type is
wRequest.Headers = wHeader
wRequest.Method = "GET"
Dim wResponse As HttpWebResponse = DirectCast(wRequest.GetResponse(), HttpWebResponse)
Dim sResponse As String = ""
Using srRead As New StreamReader(wResponse.GetResponseStream())
sResponse = srRead.ReadToEnd()
End Using
我不熟悉 smartsheet API,但您可以将其用作起点。
如果您使用的是代理,则需要添加...
Dim wProxy As IWebProxy = WebRequest.GetSystemWebProxy()
wProxy.Credentials = System.Net.CredentialCache.DefaultCredentials
并在您提出请求时指定代理...
wRequest.Proxy = wProxy