Dim result As String
Try
Dim web As New System.Net.WebClient()
web.Proxy = Nothing
web.Headers.Add("Content-Type", "application/json")
Dim body As New Newtonsoft.Json.Linq.JObject
body("username") = "xxx"
body("password") = "xxx"
result = web.UploadString("xxx", body.ToString())
Catch ex As System.Net.WebException
Dim stream As System.IO.Stream = ex.Response.GetResponseStream()
Dim reader As New System.IO.StreamReader(stream)
result = reader.ReadToEnd()
End Try
[此贴子已经被作者于2020/4/11 12:45:03编辑过]