# Help: Is it possible to send form-data instead of plain text in a HTTP PUT request logic?

**URL:** <https://community.homey.app/t/help-is-it-possible-to-send-form-data-instead-of-plain-text-in-a-http-put-request-logic/88617>\
**Category:** Developers\
**Tags:** homey-pro, logic\
**Created:** [September 2, 2023, 1:06pm UTC](https://community.homey.app/t/help-is-it-possible-to-send-form-data-instead-of-plain-text-in-a-http-put-request-logic/88617 "2023-09-02T13:06:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rikard\_Lundgren](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rikard_lundgren/32/49501_2.png) [@Rikard\_Lundgren](https://community.homey.app/u/Rikard_Lundgren)\
**Post date:** [September 2, 2023, 1:06pm UTC](https://community.homey.app/t/help-is-it-possible-to-send-form-data-instead-of-plain-text-in-a-http-put-request-logic/88617/1 "2023-09-02T13:06:54Z")

</div>

Hi,

How can I make this PUT request work from my Homey?

I’m trying to change the mode of my home energy storage (Sonnen) via Homey Pro Logic.  
It is possible through Postman when I test it with “Form-data” but when I put the same data in a Homey Logic HTTP PUT request I get the following error, see the first screenshot below.  
I have also confirmed this error via Postman by changing from “Data-form” to “Raw” = same error message.  
You should also know that I’ve tried POST request from my Homey with the variable directly in the URL which works. See the last screenshot.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/0/709aec5c110269d0773b7b75de1257e55073a3f5.png)

It works with Postman when using “form-data”:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/9/c9132143492306f95d163ff755f79c12626d2d9c.png)

But if I change to “raw” in Postman I get the same error:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/f/6f0aa8205d141b0fe2c24d739c7f97d5a2221da0.png)

Example of another type (POST) request that works from the Homey to the same equipment:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/b/5b86646f96532c80d1f44708b89c91c2a0577a88.png)

Thank you for your help!

Best regards  
Rikard

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [September 2, 2023, 1:27pm UTC](https://community.homey.app/t/help-is-it-possible-to-send-form-data-instead-of-plain-text-in-a-http-put-request-logic/88617/2 "2023-09-02T13:27:17Z")

</div>

1. 

Add header field:  
Content-type: application/json

1. 

Add JSON format to your body including { } like in your Postman screenshot.

---

<div class="post-metadata">

**Author:** ![Rikard\_Lundgren](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rikard_lundgren/32/49501_2.png) [@Rikard\_Lundgren](https://community.homey.app/u/Rikard_Lundgren)\
**Post date:** [September 2, 2023, 2:00pm UTC](https://community.homey.app/t/help-is-it-possible-to-send-form-data-instead-of-plain-text-in-a-http-put-request-logic/88617/3 "2023-09-02T14:00:33Z")

</div>

Worked like a charm. Thank you Ronny for your quick reply! \<3

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/2/92f888583de3119351000e0391de04905dcae10b.png)
