Help with http Request Post (formdata)

I just did. Still not working.

@kyqurikan

Let me know did you use JSON Input Parameter like this “{”“parentID”“: ““FEF98F4245FABCCFB2DA03FDFC254717B94CC7FC3C29””}”

and remote your headers “multipart/form-data” and try.

I just tried but i got Authorization Required output.

Thanks,
Arunachalam

I gave you the valid OAuth2 token. Just verified that that token still works in postman just now. I still see that no file uploads. That’s how I’ve been checking to see if it works or not.

@kyqurikan,

I have checked in the postman also with your supported pdf file. but it’s not supporting that pdf file.

AgilitteDemo.postman_collection.json (4.2 KB)

Just uploaded the postman collection that works.

This is where you select the pdf.

I responded with messages. I replied to myself and not you. Sorry. I uploaded the collection for postman that works.

Hi,

Did you get a solution for the same scenario using in Uipath to upload an attachment (image).

Regards,
@Spark_robot

Hi @kyqurikan

is there any idea on how to pass form-data values in http request activity ?

No solution yet?

Hello Henrik,
In this video, I use multipart/form-data:

0:20 cURL example
1:35 Send the command from POSTMAN
2:50 Implement the code in C#
4:20 Run the code
4:50 Visual Basic code VB.NET
6:20 New Process on UiPath Studio with Invoke Code
7:20 Imports Libraries in UiPath Studio
8:30 Run the Robot to Upload and Download the file

Blockquote
Dim client As HttpClient = New HttpClient()
client.BaseAddress = New Uri(“YOUR URL”)
client.DefaultRequestHeaders.Accept.Clear()
client.DefaultRequestHeaders.Accept.Add(New MediaTypeWithQualityHeaderValue(“application/vnd.openxmlformats-officedocument.wordprocessingml.document”))
// for BASIC AUTH
Dim byteArray As Byte() = Encoding.ASCII.GetBytes(“username:password”)
client.DefaultRequestHeaders.Authorization = New AuthenticationHeaderValue(“Basic”, Convert.ToBase64String(byteArray))Dim byteArray As Byte() = Encoding.ASCII.GetBytes(“username:password”)
// for OAUTH2
client.DefaultRequestHeaders.Add(“authorization”, “Bearer YOUR TOKEN”)
Dim request As MultipartFormDataContent = New MultipartFormDataContent()
request.Add(New StringContent(“tags”), “Bad”)
request.Add(New StringContent(“displayreferencetext”), “true”)
request.Add(New StringContent(“similaritythreshold”), “0.63”)
request.Add(New StreamContent(File.OpenRead(“C:\8A.docx”)), “file”, (New FileInfo(“C:\8A.docx”).Name))
Dim response As HttpResponseMessage = client.PostAsync(“”, request).Result
Dim strm As Stream = response.Content.ReadAsStreamAsync.Result
Dim doc As Byte()
Dim ms As MemoryStream = New MemoryStream()
strm.CopyTo(ms)
doc = ms.ToArray()
File.WriteAllBytes(“C:\rpa\FORDOWNLOAD\rez.docx”, doc)

Thanks,
Cristian Negulescu

Same problem here, I need to pass the password for the API in the form-data section as a key value pair (password=ThisIsThePassword).
In Postman everything works as intended but I cannot seem to get it running in UiPath.
I also tried sending it in the Body as JSON or XML but the API does not accept this (neither UiPath nor Postman)

Did it work with API key?

how to configure that?