POST请求 去找这个组件 RestSharp.dll
json的分析处理 去找这个组件Newtonsoft.Json.dll (这个要做class比较麻烦 所以你自己搜吧)
'使用RestSharp post请求
Dim client = New RestClient("url")
client.Timeout = 15000
'选择POST / GET
Dim request = New RestRequest(Method.POST)
'上传图片
request.AddFile("smfile", File.ReadAllBytes(data), Path.GetFileName(data))
request.AlwaysMultipartFormData = True
'以下程式码等同上面那句
' request.AddParameter("Content-Type", "multipart/form-data", ParameterType.HttpHeader)
'添加api key
request.AddParameter("Authorization", "BV**********ySu", ParameterType.HttpHeader)
Dim result = client.Execute(request)
'接收到的json
MsgBox( result.Content)
json的分析处理 去找这个组件Newtonsoft.Json.dll (这个要做class比较麻烦 所以你自己搜吧)
'使用RestSharp post请求
Dim client = New RestClient("url")
client.Timeout = 15000
'选择POST / GET
Dim request = New RestRequest(Method.POST)
'上传图片
request.AddFile("smfile", File.ReadAllBytes(data), Path.GetFileName(data))
request.AlwaysMultipartFormData = True
'以下程式码等同上面那句
' request.AddParameter("Content-Type", "multipart/form-data", ParameterType.HttpHeader)
'添加api key
request.AddParameter("Authorization", "BV**********ySu", ParameterType.HttpHeader)
Dim result = client.Execute(request)
'接收到的json
MsgBox( result.Content)