# HTTP request using form-data

**URL:** <https://forum.uipath.com/t/http-request-using-form-data/484762>\
**Category:** Help\
**Tags:** web, question, activities, webapi\
**Created:** [October 26, 2022, 10:27pm UTC](https://forum.uipath.com/t/http-request-using-form-data/484762 "2022-10-26T22:27:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_K](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@Robert\_K](https://forum.uipath.com/u/Robert_K)\
**Post date:** [October 26, 2022, 10:27pm UTC](https://forum.uipath.com/t/http-request-using-form-data/484762/1 "2022-10-26T22:27:14Z")

</div>

I have this PHP Code that I want to put into UiPath Request

> ```auto
> $values = array(
> 'order_type' => 2, // 2 dropshipping courier, 3 dropshipping with self pick-up (default is 2)
> 'client_order_name' => 'Popescu Ion', // 'text' (mandatory)
> 'client_order_number' => '12647098', // numeric (mandatory)
> 'message' => 'Your message for seller', // text (optional)
> 'url_awb' => 'https://www.domain.tld/path/awb.pdf', // url (mandatory)
> 'products' => [
> [
> 'sku' => '60969',
> 'description' => '', // text (optional)
> 'quantity' => 1
> ]
> ]
> );
> $curl = curl_init();
> curl_setopt_array($curl, array(
> CURLOPT_URL => "https://www.partenerviva.ro/api/orders/new",
> CURLOPT_CUSTOMREQUEST => "POST",
> CURLOPT_POSTFIELDS => http_build_query($values),
> CURLOPT_HTTPHEADER => array("API-KEY:your-api-key-or-token"),
> CURLOPT_RETURNTRANSFER => true,
> CURLOPT_HEADER => 0,
> CURLOPT_TIMEOUT => 30,
> CURLOPT_CONNECTTIMEOUT => 5
> ));
> $response = curl_exec($curl);
> $err = curl_error($curl);
> curl_close($curl);
> if ($err) {
> echo "cURL Error #:" . $err;
> } else {
> echo $response;
> }
> 
> ```

```auto

I managed to put it into Postman but it's not the best way because it's difficult to use it in UiPath.

![image|690x298](upload://mW7n6wmngOwYC9GXdCdyvny2KU9.png)

I need a way to send the parameter just as **product[]** and the rest in the value, or some way in which I can pass a variable with all other informations.

Any ideas of how I can transport pruduct[0][sku], product[0][quantity], etc. into just one variable products[]?
```

---

<div class="post-metadata">

**Author:** ![Nithinkrishna](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nithinkrishna/32/561519_2.png) [@Nithinkrishna](https://forum.uipath.com/u/Nithinkrishna)\
**Post date:** [October 27, 2022, 5:46am UTC](https://forum.uipath.com/t/http-request-using-form-data/484762/2 "2022-10-27T05:46:46Z")

</div>

Hey @Robert_K

Your image is not proper can you please re-upload

And also please share the postman request CURL

Thanks  
#nK

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [October 27, 2022, 5:58am UTC](https://forum.uipath.com/t/http-request-using-form-data/484762/3 "2022-10-27T05:58:23Z")

</div>

> [@Robert\_K](#):
>
> `![image|690x298](upload://mW7n6wmngOwYC9GXdCdyvny2KU9.png)`

@Robert_K , Kindl, Don’t paste images within in quotes. It will not show pictures.

 ![image](https://global.discourse-cdn.com/uipath/original/4X/a/0/c/a0c1b075636d01ade38fda2adfb0ce2513346541.png)

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [October 27, 2022, 6:07am UTC](https://forum.uipath.com/t/http-request-using-form-data/484762/4 "2022-10-27T06:07:58Z")

</div>

> [@Robert\_K](#):
>
> I have this PHP Code that I want to put into UiPath Request

Hello @Robert_K

1. Download the `Uipath.WebAPI.Activities` from the manage packages and install it.  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/5/3/3/533da5856000f4edffc980b681aceb192292857f.png)
2. Use HTTP request activity and pass your API key.  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/0/8/e/08ea95054b40fb64a244d46879c1469cb4b76e1c.png)

 ![image](https://global.discourse-cdn.com/uipath/original/4X/f/a/0/fa03f640bedb56982a04867f734c08b763962880.png)

Kindly refer to this thread, you may get idea

[![](https://global.discourse-cdn.com/uipath/original/4X/b/9/2/b92a313e04c7b8e24a7014e3217977e95ea86711.jpeg "API | UiPath Automation API | HTTP Request | HTTP Response | API Call in UIPath") ](https://www.youtube.com/watch?v=98SR0WOFUZo)

---

<div class="post-metadata">

**Author:** ![Robert\_K](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@Robert\_K](https://forum.uipath.com/u/Robert_K)\
**Post date:** [October 27, 2022, 6:21am UTC](https://forum.uipath.com/t/http-request-using-form-data/484762/5 "2022-10-27T06:21:42Z")

</div>

I know how to use APIs, used them a lot.

I don’t know how to put the product Array in the parameter! It’s variable, it could have 3,4,10,100 elements! How can I put that into parameteres because now I put products[0][sku],… products[1][sku]… etc.

---

<div class="post-metadata">

**Author:** ![Robert\_K](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@Robert\_K](https://forum.uipath.com/u/Robert_K)\
**Post date:** [October 27, 2022, 6:23am UTC](https://forum.uipath.com/t/http-request-using-form-data/484762/6 "2022-10-27T06:23:21Z")

</div>

It’s not logic I put 100 elements from products[1] to products[100] as parameters and leave them blank… I don’t know even if the server will accept blank posts, or will create blank products…

---

<div class="post-metadata">

**Author:** ![Robert\_K](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@Robert\_K](https://forum.uipath.com/u/Robert_K)\
**Post date:** [October 27, 2022, 6:24am UTC](https://forum.uipath.com/t/http-request-using-form-data/484762/7 "2022-10-27T06:24:24Z")

</div>

> [@Robert\_K](#):
>
> ```auto
> need a way to send the parameter just as **product[]** and the rest in the value, or some way in which I can pass a variable with all other informations.
> 
> Any ideas of how I can transport pruduct[0][sku], product[0][quantity], etc. into just one variable products[]?
> 
> ```

@Gokul_Jayakumar this was my question

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [October 27, 2022, 7:33am UTC](https://forum.uipath.com/t/http-request-using-form-data/484762/8 "2022-10-27T07:33:55Z")

</div>

> [@Robert\_K](#):
>
> @Gokul_Jayakumar this was my question

> [@Robert\_K](#):
>
> It’s variable,

@Robert_K  
If it is in a variable, pass API and parameters as a variable in the Properties of the HTTP request.

 ![image](https://global.discourse-cdn.com/uipath/original/4X/f/8/e/f8ea947e920944eb5a8a24af5cc6d8502044e78d.png)
