Dim client As RestClient = New RestClient("https://apimxxxxxxxx")
client.Timeout = 10000
Dim request As RestRequest= New RestRequest(Method.POST)
request.AddHeader("Content-Type", "fihier/pdf")
request.AddParameter("fichier/pdf", File.ReadAllBytes( fichier), ParameterType.RequestBody)
Dim response As IRestResponse = client.Execute(request)
Console.WriteLine(response.Content)
I got the error:
erreur BC30561 : ‘RestClient’ est ambigu, importé des espaces de noms ou des types ‘UiPath.Web, RestSharp’. À la ligne 1
erreur BC30561 : ‘RestClient’ est ambigu, importé des espaces de noms ou des types ‘UiPath.Web, RestSharp’. À la ligne 1
erreur BC30561 : ‘Method’ est ambigu, importé des espaces de noms ou des types ‘UiPath.Web, RestSharp’. À la ligne 3
Try to downgrade the RestSharp dependence version 106.10.1 and try with the below code
Dim client As RestSharp.RestClient = New RestSharp.RestClient("https://apimxxxxxxxx")
client.Timeout = 10000
Dim request As RestRequest= New RestRequest(RestSharp.Method.POST)
request.AddHeader("Content-Type", "fihier/pdf")
request.AddParameter("fichier/pdf", File.ReadAllBytes( fichier), ParameterType.RequestBody)
Dim response As IRestResponse = client.Execute(request)
Console.WriteLine(response.Content)
If your call returns a response, how do you write the code to do this? My http call returns an ID from this response. Your code works great, I just need to know how to code an out argument to return the id written in the Console.WriteLine(reponse.Content) line. Any suggestions are greatly appreciated.