Rest Api using assign activity

Hi All,

Does Anybody know how to make the code in uipath using assign activity?
If you very well please give idea to complete.

var client = new RestClient(“My endpoint url”);
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader(“Content-Type”, “application/x-www-form-urlencoded”);
request.AddFile("", “File Path”);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Regards.
@Spark_robot

1 Like

Hi
If we have the endpoint url and token on hand
Then we can directly use HTTP REQUEST activity
For that go to Design tab -> Manage Packages -> in Official tab search for UiPath.Web.Activities And download, install it

Once after installing, back in studio search as Http Request and enter the property with appropriate values

Cheers @Spark_robot

Thanks @Palaniyappan
I have to pass image file , in post man i given the path in form data but here it was difficult.
Regards,
@Spark_robot

Hi @Spark_robot,
why you are not using the invoke code activity? you can pass the file path as argument.

1 Like

Thanks @shankm,

I will try and update.

Regards,
@Spark_robot

1 Like

Hi @shankm

Please Let me know the argument passed was correct or not?
Because, this was first time am using invoke code activity.

Thanks & Regards,
@Spark_robot

1 Like

Thanks @shankm it worked well.
Thanks @Palaniyappan for your kind support.

Regards,
@Spark_robot

2 Likes

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