Issues with Web Request Action - Auth Header Issue?


#1

1) Give a description of the problem
Trying to integrate a Genie Aladdin Connect garage door opener, but I am not able to activate the door via the Make a Web Request State. I have this working in Postman, and I believe the headers are getting mangled when I implement via webcore.

I am activating the piston from a Virtual Switch, then turning the switch off 15 seconds later for simplicity while I try to get the POST action working.

2) What is the expected behaviour?
Headers should look like this:
POST /onep:v1/rpc/process HTTP/1.1
Host: genie.m2.exosite.com
AppVersion: 2.10.1
BundleName: com.geniecompany.AladdinConnect
User-Agent: Aladdin Connect Android v2.10.1
BuildVersion: 131
Content-Type: application/json
Authorization: Basic lkajdsfljksdfljksdflksdflklkjsdfljsdfaalk
Accept: /
Cache-Control: no-cache
Postman-Token: 95845c09-f92a-4c3b-af6a-193fce0d3de9,1bbc0d5a-fbea-4789-8ac0-65987f134fab
Host: genie.m2.exosite.com
Accept-Encoding: gzip, deflate
Content-Length: 632
Connection: keep-alive
cache-control: no-cache

3) What is happening/not happening?
Actual headers:
{
“content-length”: “346”,
“accept”: “/”,
“authorization”: “AppVersion: 2.10.1 BundleName: com.geniecompany.AladdinConnect User-Agent: Aladdin Connect Android v2.10.1 BuildVersion: 131 Content-Type: application/json Authorization: Basic ljkasdfljasdflkjasdlfkjalsdjf”,
“content-type”: “application/json”,
“user-agent”: “Apache-HttpClient/4.5.2 (Java/1.7.0_201)”,
“accept-encoding”: “gzip,deflate”
}

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
|+1ms|╔Received event [Garage Open].switch = off with a delay of 86ms|
| — | — |
|+97ms|║RunTime Analysis CS > 17ms > PS > 51ms > PE > 28ms > CE|
|+99ms|║Runtime (42487 bytes) successfully initialized in 51ms (v0.3.10f.20190822) (97ms)|
|+100ms|║╔Execution stage started|
|+107ms|║║Comparison (enum) off changes_to (string) on = false (1ms)|
|+108ms|║║Cancelling condition #2’s schedules…|
|+109ms|║║Condition #2 evaluated false (5ms)|
|+110ms|║║Cancelling condition #1’s schedules…|
|+111ms|║║Condition group #1 evaluated false (state changed) (7ms)|
|+113ms|║╚Execution stage complete. (12ms)|
|+114ms|╚Event processed successfully (114ms)|
|10/2/2019, 7:35:50 PM +141ms|
|+2ms|╔Received event [Home].time = 1570062951781 with a delay of -1640ms|
|+195ms|║RunTime Analysis CS > 47ms > PS > 111ms > PE > 37ms > CE|
|+197ms|║Runtime (42494 bytes) successfully initialized in 111ms (v0.3.10f.20190822) (195ms)|
|+198ms|║╔Execution stage started|
|+230ms|║║Executed physical command [Garage Open].off() (13ms)|
|+231ms|║║Executed [Garage Open].off (17ms)|
|+233ms|║╚Execution stage complete. (35ms)|
|+235ms|╚Event processed successfully (234ms)|
|10/2/2019, 7:35:36 PM +205ms|
|+2ms|╔Received event [Garage Open].switch = on with a delay of 103ms|
|+129ms|║RunTime Analysis CS > 21ms > PS > 74ms > PE > 34ms > CE|
|+131ms|║Runtime (42494 bytes) successfully initialized in 74ms (v0.3.10f.20190822) (128ms)|
|+132ms|║╔Execution stage started|
|+139ms|║║Comparison (enum) on changes_to (string) on = true (0ms)|
|+141ms|║║Cancelling condition #2’s schedules…|
|+142ms|║║Condition #2 evaluated true (5ms)|
|+143ms|║║Cancelling condition #1’s schedules…|
|+143ms|║║Condition group #1 evaluated true (state changed) (7ms)|
|+145ms|║║Cancelling statement #3’s schedules…|
|+155ms|║║Sending external web request to: mikedeal.free.beeceptor.com|
|+570ms|║║Executed virtual command [Garage Open].httpRequest (416ms)|
|+574ms|║║Executed virtual command [Garage Open].wait (0ms)|
|+575ms|║║Requesting a wake up for Wed, Oct 2 2019 @ 7:35:51 PM CDT (in 15.0s)|
|+579ms|║╚Execution stage complete. (447ms)|
|+581ms|║Setting up scheduled job for Wed, Oct 2 2019 @ 7:35:51 PM CDT (in 14.996s)|
|+589ms|╚Event processed successfully (589ms)|


#2

So I was able to get this working, turns out that I must have had a hidden character in my JSON request. On to parsing questions and trying to optimize my piston!