# "Logica" flow card with multiple headers

**URL:** <https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462>\
**Category:** Developers\
**Created:** [June 15, 2019, 6:57pm UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462 "2019-06-15T18:57:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 15, 2019, 6:57pm UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/1 "2019-06-15T18:57:41Z")

</div>

I’m trying to setup a flowcard “Logica” / “Logic” to perform a POST request.  
But when i try to add mutiple headers:

Content-Type: application/json, X-AUTHKEY: ABCDEF  
The second header is not correctly splitup

my php $\_SERVER request headers are:

```auto
'PHP_FCGI_CHILDREN' => '4',
    'PWD' => '/fcgi-bin',
    'SHLVL' => '0',
    'PHP_FCGI_MAX_REQUESTS' => '200',
    '__CF_USER_TEXT_ENCODING' => '0x1F6:0x0:0x5',
    'ORIG_SCRIPT_NAME' => '/fcgi-bin/php7.2.14.fcgi',
    'ORIG_PATH_TRANSLATED' => '/A/htdocs/index.php',
    'ORIG_PATH_INFO' => '/index.php',
    'ORIG_SCRIPT_FILENAME' => '/fcgi-bin/php7.2.14.fcgi',
    'SCRIPT_NAME' => '/index.php',
    'REQUEST_URI' => '/',
    'QUERY_STRING' => '',
    'REQUEST_METHOD' => 'GET',
    'SERVER_PROTOCOL' => 'HTTP/1.1',
    'GATEWAY_INTERFACE' => 'CGI/1.1',
    'REDIRECT_URL' => '/index.php',
    'REMOTE_PORT' => '34580',
    'SCRIPT_FILENAME' => '/htdocs/index.php',
    'SERVER_ADMIN' => 'you@example.com',
    'DOCUMENT_ROOT' => '/htdocs',
    'REMOTE_ADDR' => '10.0.0.52',
    'SERVER_PORT' => '80',
    'SERVER_ADDR' => '10.0.0.59',
    'SERVER_NAME' => 'localhost.10.0.0.59.xip.io',
    'SERVER_SOFTWARE' => 'Apache',
    'SERVER_SIGNATURE' => '',
    'PATH' => '/usr/bin:/bin:/usr/sbin:/sbin',
    'HTTP_HOST' => 'localhost.10.0.0.59.xip.io',
    'HTTP_CONNECTION' => 'close',
    'HTTP_ACCEPT_ENCODING' => 'gzip,deflate',
    'HTTP_ACCEPT' => '*/*',
    **'CONTENT_TYPE' => 'application/json, X-AUTHKEY',**
    'HTTP_USER_AGENT' => 'Homey',
    'REDIRECT_STATUS' => '200',
    'REDIRECT_HANDLER' => 'php-fastcgi',
    'FCGI_ROLE' => 'RESPONDER',
    'PHP_SELF' => '/index.php',
    'REQUEST_TIME_FLOAT' => 1560624802.06124,
    'REQUEST_TIME' => 1560624802,

```

is it even possible to add mutiple headers?? i’ve tried a lot of thing as the sepator:  
: ; ,

but all 3 won’t work.

Does anybody know how the headers syntax is? Thanks!

---

<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:** [June 16, 2019, 7:48am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/2 "2019-06-16T07:48:59Z")

</div>

Each header should be on a separate line:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/2/21ddedb202623413d650ae73380f8b8b2b10db3a.jpeg)  
(I can add a line break using Shift-Enter in the web editor, not sure if this is possible in the mobile app)

The result:

```auto
POST / HTTP/1.1
User-Agent: Homey
Content-Type: application/json
X-Foo: bar
Accept: */*
Content-Length: 2
Accept-Encoding: gzip,deflate
Connection: close

```

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 16, 2019, 9:29am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/3 "2019-06-16T09:29:56Z")

</div>

@robertklep i’m trying to add “Shift+Enter” to paste second header on a new line, but the input field is not allowing me to add an “shift-enter”.  
I’ve tried “firefox” and “chrome” on “mac os x”  
Also i cannot set the cursor pointer to for example in the middle of the text. it just jumps to the last character of the whole text.

when i do a “normal” enter, or when I use a very long code (ex. X-Foo: BAAAAAAAAAAAAAAAAAAAAAAAAR)  
it wil automatically go to the next line but then when i look at the server responses it get this:

‘CONTENT\_TYPE’ =\> ‘application/json©X-AUTHKEY’,  
‘HTTP\_USER\_AGENT’ =\> ‘Homey’,  
‘REDIRECT\_STATUS’ =\> ‘200’,

 ![17](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/6/66de010be8caf8a04b292f9d9b0b94cf088e0739.png)

---

<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:** [June 16, 2019, 10:00am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/4 "2019-06-16T10:00:22Z")

</div>

I use Chrome on macOS and Shift-Enter works. I also don’t have the problem that you’re describing that the cursor jumps to the last character. Are you using a Chrome extension that might be causing that?

Entering a long string until it’s shown on the next line won’t work, it needs to be a hard enter/return.

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 16, 2019, 10:02am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/5 "2019-06-16T10:02:15Z")

</div>

Well i think i found the issue. but BOY! those input fields are not User Friendly  
All the time cursor jumps to end of the text.  
I had to use the LEFT SHIFT (and i used the right shift)  
Also it’s not possible to drag those tags to the right place in the text. but that’s a different issue.

For now i found the problem and fixed it with using the LEFT SHIFT 😃

Thanks @robertklep for pointing out the Shift method!

But i would like to see better also a json string in the headers.

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 16, 2019, 10:05am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/6 "2019-06-16T10:05:01Z")

</div>

Yes it could be an extension problem

Everytime i click in the textarea field in the middle i also get a javascript warning:

[Violation] Forced reflow while executing JavaScript took 300ms  
[Violation] Forced reflow while executing JavaScript took 75ms  
[Violation] Forced reflow while executing JavaScript took 302ms  
[Violation] Forced reflow while executing JavaScript took 282ms  
[Violation] Forced reflow while executing JavaScript took 305ms  
[Violation] Forced reflow while executing JavaScript took 275ms  
[Violation] Forced reflow while executing JavaScript took 614ms  
[Violation] Forced reflow while executing JavaScript took 78ms  
[Violation] Forced reflow while executing JavaScript took 298ms  
[Violation] Forced reflow while executing JavaScript took 289ms  
[Violation] Forced reflow while executing JavaScript took 304ms  
[Violation] Forced reflow while executing JavaScript took 285ms  
[Violation] Forced reflow while executing JavaScript took 306ms  
[Violation] Forced reflow while executing JavaScript took 76ms

I will check guest mode without extensions enabled.

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 16, 2019, 10:06am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/7 "2019-06-16T10:06:56Z")

</div>

Yep conclusion of the cursor problem is an extension.  
Thanks again @robertklep

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 16, 2019, 10:12am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/8 "2019-06-16T10:12:21Z")

</div>

Ooh no, in the “Body” field, even in guest mode, the cursor goes to the end everytime.  
I looks like it’s loading everytime something from the Shadow-DOM into the contenteditable field.

I cannot edit the field anymore. i have to use the app to change text.

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 16, 2019, 10:30am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/9 "2019-06-16T10:30:10Z")

</div>

Also i noticed, iphone when you put " " arround a key they are a different type of quotes. these: “ and they don’t get replaced by ".

it’s not my day today. to many issues setting up one flow card xD.

---

<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:** [June 16, 2019, 10:49am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/10 "2019-06-16T10:49:49Z")

</div>

Those quotes might be because of an iOS setting (“smart quotes” or something).

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 17, 2019, 7:08am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/11 "2019-06-17T07:08:03Z")

</div>

@robertklep, not so smart then afterall 😉

Other problem i still have is the editability of the body field. First of all, it’s slow (like javascript is doing something every time i do an input in that field.)  
Second: from the moment i put a “tag card” into the body field i cannot edit anything in the body field anymore.  
So again stuck getting back to my iphone app, and add or remove text there.

I’ve tried in Chrome,Firefox,Safari. all the same problem again (disabled all extensions by entering guestmode)

What i’ve typed was this in to the body field:

```
{ "timestamp" : " (inserted here a Date tag)

```

after I added the date tag i cannot edit the whole body field anymore. Dragging and dropping tagfields is also not possible.

I will search for the “smart quotes on ios” thnx!

---

<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:** [June 17, 2019, 7:12am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/12 "2019-06-17T07:12:31Z")

</div>

Tag cards don’t work properly for me either when I try to use them inside JSON data.

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 17, 2019, 10:08am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/13 "2019-06-17T10:08:16Z")

</div>

@robertklep i conclude this method is just unusable, it’s cumbersome and not UserFriendly

Now all my post json data has “spaces” after each tag

```
array (
'timestamp' => '17-06-2019 T09:24 ',
'electricity_delivered_1' => '5589.29 ',
'electricity_returned_1' => '410.88 ',
'electricity_delevered_2' => '3182.6 ',
'electricity_returned_2' => '811.99 ',
'electricity_currently_delivered' => '510 ',
'electricity_currently_returned' => '0',
'extra_device_delivered' => '0.001 ',

```

),

i will stop trying for now, until the flow editor is improved. Again thank you for your support. i did become wiser in the “smart quotes” on iOS though 😉

---

<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:** [June 17, 2019, 11:22am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/14 "2019-06-17T11:22:51Z")

</div>

Perhaps it’s easier to use [HomeyScript](https://apps.athom.com/app/com.athom.homeyscript)?

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 17, 2019, 11:24am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/15 "2019-06-17T11:24:05Z")

</div>

yes i was already trying but need the OAuth scope access: homey.flow

```
let new_flow = await Homey.flow.updateFlow({
id: '727f1862-8b34-45e2-805a-b2b5c2cf3b6e',
flow: [ { uri: 'homey:manager:logic',
id: 'http',
group: 'then',
args: 
 { method: 'post',
   url: 'http://localhost.10.0.0.59.xip.io/',
   headers: 'Content-Type: application/json\nX-AUTHKEY: [[homey:app:net.i-dev.betterlogic|X-AUTHKEY]]',
   body: '{ "timestamp":"[[homey:manager:cron|date]]T[[homey:manager:cron|time]] ", "electricity_delivered_1":"[[homey:device:45f27888-c506-4d3c-a800-1954d803e3e3|meter_power.offPeak]]","electricity_returned_1":"[[homey:device:45f27888-c506-4d3c-a800-1954d803e3e3|meter_power.producedOffPeak]]","electricity_delevered_2":"[[homey:device:45f27888-c506-4d3c-a800-1954d803e3e3|meter_power.peak]]","electricity_returned_2":"[[homey:device:45f27888-c506-4d3c-a800-1954d803e3e3|meter_power.producedPeak]]","electricity_currently_delivered":"[[homey:device:45f27888-c506-4d3c-a800-1954d803e3e3|measure_power]]","electricity_currently_returned":"0","extra_device_delivered":"[[homey:device:45f27888-c506-4d3c-a800-1954d803e3e3|measure_gas]]" }' },
delay: null,
duration: null } ] });

```

returns: “Je hebt geen toegang om dit te doen” / “You have no permissions to execute this”

---

<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:** [June 17, 2019, 11:25am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/16 "2019-06-17T11:25:08Z")

</div>

I meant performing the entire POST request from HomeyScript 🙂

The example [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Supplying_request_options) shows how to make a POST request using custom headers and a JSON body.

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 17, 2019, 11:27am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/17 "2019-06-17T11:27:05Z")

</div>

I did like the updateFlow method 😃 but i will program a full POST request

---

<div class="post-metadata">

**Author:** ![eelco2k](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelco2k/32/12766_2.png) [@eelco2k](https://community.homey.app/u/eelco2k)\
**Post date:** [June 17, 2019, 11:33am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/18 "2019-06-17T11:33:37Z")

</div>

But still strange it’s not allowed to exec.

let scopes = await Homey.hasScopes(‘homey.flow’); returns true

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [June 17, 2019, 2:22pm UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/20 "2019-06-17T14:22:12Z")

</div>

Moved to developers.

---

<div class="post-metadata">

**Author:** ![DieJan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/diejan/32/23130_2.png) [@DieJan](https://community.homey.app/u/DieJan)\
**Post date:** [January 24, 2020, 8:01am UTC](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462/21 "2020-01-24T08:01:43Z")

</div>

I also experience the issue where the cursor jumps to the last place in the input field, in some of my flow cards input fields.

There is no difference in using Internet Explorer or Google Chrome, even in incognito mode with all extensions disabled. Also the flow editor gets laggy when moving between flow cards.

[Next page](https://community.homey.app/t/logica-flow-card-with-multiple-headers/14462.md?page=2)
