Post 使用 RestSharp 的方法在 [=11th=] 请求中出错
Post method uing RestSharp got error in return request
我正在使用 nuget 安装 RestSharp -Version 107.0.1,我添加以下代码在 return 请求
中出现错误
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim client As RestClient = New RestClient("https://sampel.com/uploadDate")
Dim request = New RestRequest(Method.Post)
request.AddParameter("company_name", "Sample")
request.AddParameter("username", "admin")
request.AddFile("file", "E:\Stack\rick.png")
request.AddParameter("processing_pref", "accuracy")
request.AddParameter("document", "Image")
request.AddParameter("type", "Sale")
Dim response2 As IRestResponse = client.Execute(request)' here i get code error any dll i am missing ?
End Sub
截图 - https://prnt.sc/5OE518W4Hmqw
注意:我只引用了使用 nuget 的 RestSharp dll
感谢和问候
亚拉文
替换为
Dim response2 = Await client.ExecuteAsync(request)
所有内容都有文档记录,所以也许您应该花点时间阅读文档。
试试 RestSharp - 版本 105.2.3.0
我正在使用 nuget 安装 RestSharp -Version 107.0.1,我添加以下代码在 return 请求
中出现错误 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim client As RestClient = New RestClient("https://sampel.com/uploadDate")
Dim request = New RestRequest(Method.Post)
request.AddParameter("company_name", "Sample")
request.AddParameter("username", "admin")
request.AddFile("file", "E:\Stack\rick.png")
request.AddParameter("processing_pref", "accuracy")
request.AddParameter("document", "Image")
request.AddParameter("type", "Sale")
Dim response2 As IRestResponse = client.Execute(request)' here i get code error any dll i am missing ?
End Sub
截图 - https://prnt.sc/5OE518W4Hmqw
注意:我只引用了使用 nuget 的 RestSharp dll 感谢和问候
亚拉文
替换为
Dim response2 = Await client.ExecuteAsync(request)
所有内容都有文档记录,所以也许您应该花点时间阅读文档。
试试 RestSharp - 版本 105.2.3.0