# Send HTTP PUT request with headers and body and check response

**URL:** <https://community.homey.app/t/send-http-put-request-with-headers-and-body-and-check-response/84925>\
**Category:** Questions & Help\
**Created:** [July 20, 2023, 9:38am UTC](https://community.homey.app/t/send-http-put-request-with-headers-and-body-and-check-response/84925 "2023-07-20T09:38:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaptainVoni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/captainvoni/32/3549_2.png) [@CaptainVoni](https://community.homey.app/u/CaptainVoni)\
**Post date:** [July 20, 2023, 9:38am UTC](https://community.homey.app/t/send-http-put-request-with-headers-and-body-and-check-response/84925/1 "2023-07-20T09:38:55Z")

</div>

I have a working script that uses curl to request the state of a charging station and act on the response. I want to move that task to homey. First here is the working curl command line:

```auto
curl -o - -f -s -X POST -H "Accept: applicion/json, text/plain, */*" -H "Content-Type: application/json;charset=utf-8" -H "O
rigin: https://oebb.smatrics.com" -H "DNT: 1" -H "Referer: https://oebb.smatrics.com/de/" -H "Sec-Fetch-Dest: empty" -H "Sec-Fetch-Mode: cors" -H "Sec-Fetc
h-Site: same-origin" -d '{"evseIds":["AT*SMA*EAT0301891*001AC"]}' "https://oebb.smatrics.com/de/map/poi-status"

```

The return from the server looks like this:

```auto
{"AT*SMA*EAT0301891*001AC":"OCCUPIED"}

```

And here is my try to recreate that request in Homey:

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/9/4968a2104832ac3815de0afac69f68e70d2ff185.png)

I copied all the headers and the body directly from the script to Homey. I added all the headers separated with Shift-Enter. The request comes from the same network. The curl options “-f” and “-s” can be removed without any change in response. The manual for the “-d” option from curl reads as:

> (HTTP MQTT) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button. This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded.

The content type is obviously overriden by the headers in the curl-request.

No matter what I try, I always receive a “403” in Homey. I would be thanksful for any hints or ideas.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 20, 2023, 10:11am UTC](https://community.homey.app/t/send-http-put-request-with-headers-and-body-and-check-response/84925/2 "2023-07-20T10:11:45Z")

</div>

Looks like the Logic “Make HTTP request” card is broken, it cuts off header lines after the second colon which mangles the `Referer` header. Reported on Slack, but it’ll require a firmware update to fix it 🙄

---

<div class="post-metadata">

**Author:** ![CaptainVoni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/captainvoni/32/3549_2.png) [@CaptainVoni](https://community.homey.app/u/CaptainVoni)\
**Post date:** [July 20, 2023, 11:18am UTC](https://community.homey.app/t/send-http-put-request-with-headers-and-body-and-check-response/84925/3 "2023-07-20T11:18:49Z")

</div>

Thanks for the info. I will then wait for a fix.

---

<div class="post-metadata">

**Author:** ![CaptainVoni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/captainvoni/32/3549_2.png) [@CaptainVoni](https://community.homey.app/u/CaptainVoni)\
**Post date:** [September 9, 2023, 1:40pm UTC](https://community.homey.app/t/send-http-put-request-with-headers-and-body-and-check-response/84925/4 "2023-09-09T13:40:54Z")

</div>

Just wanted to report back: this works now. Thanks for the fix!  
 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/6/76517ed6c8923650a227a0fe3a4d606b1d8c3070.png)
