Home > Software design >  Post method uing RestSharp got error in return request
Post method uing RestSharp got error in return request

Time:04-05

I am install RestSharp -Version 107.0.1 using nuget, and i add below code getting error in return request

 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

Screenshot - https://prnt.sc/5OE518W4Hmqw

Note : i referred only RestSharp dll using nuget Thanks and Regards

Aravind

CodePudding user response:

try RestSharp -Version 105.2.3.0

CodePudding user response:

Replace it with

Dim response2 = Await client.ExecuteAsync(request)

It is all documented, so maybe you should spend a bit of time reading the docs.

  • Related