# Parameters in multipart/form data in pub.client:http

**URL:** <https://techcommunity.softwareag.com/t/parameters-in-multipart-form-data-in-pub-client-http/236330>\
**Category:** Forum\
**Tags:** flow-services, AG-Designer\
**Created:** [January 20, 2021, 6:46am UTC](https://techcommunity.softwareag.com/t/parameters-in-multipart-form-data-in-pub-client-http/236330 "2021-01-20T06:46:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![meitha95](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/meitha95/32/23916_2.png) [@meitha95](https://techcommunity.softwareag.com/u/meitha95)\
**Post date:** [January 20, 2021, 6:46am UTC](https://techcommunity.softwareag.com/t/parameters-in-multipart-form-data-in-pub-client-http/236330/1 "2021-01-20T06:46:59Z")

</div>

```auto
Hello,

I need to insert 2 parameters with multipart/form-data in pub.client:http. I already put content-type: multipart/form-data in headers and put the parameters inside args, but it didn't work. Anyone knows how to pass 2 parameters multipart/form-data in pub.client:http ???

```

---

<div class="post-metadata">

**Author:** ![Prabaa](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/prabaa/32/15640_2.png) [@Prabaa](https://techcommunity.softwareag.com/u/Prabaa)\
**Post date:** [February 2, 2021, 8:33am UTC](https://techcommunity.softwareag.com/t/parameters-in-multipart-form-data-in-pub-client-http/236330/2 "2021-02-02T08:33:30Z")

</div>

Hi Sabrina,  
You can the parameters as data in any format i.e. String, bytes or stream.

What is the error you are seeing?

![image](https://global.discourse-cdn.com/techcommunity/original/2X/c/c6ba728cba3da605bb626b4824b41f978ec4439c.png)

Regards,  
Praba.

---

<div class="post-metadata">

**Author:** ![reamon](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@reamon](https://techcommunity.softwareag.com/u/reamon)\
**Post date:** [February 11, 2021, 11:29pm UTC](https://techcommunity.softwareag.com/t/parameters-in-multipart-form-data-in-pub-client-http/236330/3 "2021-02-11T23:29:32Z")

</div>

Are you sure you need to use multipart/form-data? Per the documentation,

> When you submit data using args , Integration  
> Server automatically sets the value of the Content-  
> Type header to application/x-www-formurlencoded.

This sends the parameters as a query string in the URL for the GET method and in the HTTP body for the POST method. This should be sufficient for typical text arguments.

The doc continues:

> If you want to explicitly specify a different Content-  
> Type value, you must submit the value using the  
> string or bytes variable.

The reason to use multipart/form-data is if the data of one or more of the fields contains lots of non-text data. To use that Content-Type, you’ll need to do more work to create the payload yourself with the pub.mime services.

Do the 2 fields contain simple text values? If so, use the application/x-www-formurlencoded approach. If not, review the pub.mime services.

---

<div class="post-metadata">

**Author:** ![Jaideep](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/jaideep/32/15623_2.png) [@Jaideep](https://techcommunity.softwareag.com/u/Jaideep)\
**Post date:** [February 16, 2021, 8:14am UTC](https://techcommunity.softwareag.com/t/parameters-in-multipart-form-data-in-pub-client-http/236330/4 "2021-02-16T08:14:27Z")

</div>

Hi Shabrina,  
As @ reamon mentioned, you need to use pub.mime services to create a mime object with multiple parts (attachments) and then use to send that stream in the pub.client:http.

This thread [How to send a mimestream using pub.client:http - Forum - Software AG Tech Community & Forums](https://techcommunity.softwareag.com/t/how-to-send-a-mimestream-using-pub-client-http/198523/6) might be useful for you.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [May 17, 2021, 8:14am UTC](https://techcommunity.softwareag.com/t/parameters-in-multipart-form-data-in-pub-client-http/236330/5 "2021-05-17T08:14:27Z")

</div>

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