How to setup HTTP request where body is form-data (Uploading Files)

Hi team,

I have an issue with an HTTP request.
i have an end point url.
in Body, 2 parameters. first one is a string and second one is a file.
Body Type is form-data in postman.

how to setup this in uipath http request.

1 Like

Issue Fixed.

Dim client As RestClient = New RestClient(“http://xxxxxxxx”)
client.Timeout = -1
Dim request As RestRequest = New RestRequest(Method.POST)
request.AddParameter(“file”, “abc_1.jpeg”) //request.AddParameter("body param name”, “param value”)
request.AddParameter(“userId”, “Jishnu.PNair”) \second param and its values
request.AddFile(“file”, “XXXXXXXX\abc_1.jpeg”) \ file that need to be uploaded - param and its value
Dim response As IRestResponse = client.Execute(request)
Console.WriteLine(response.Content)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.