Http binding POST does not work as expected


while investigating http binding, I found an issue. When defining an item like

Switch myTest1 {http=">[*:POST:http://myserverip/index.html?cmd=%2$s] " }
Switch myTest2 {http=">[*:POST:http://myserverip/index.html:default] " }
Switch myTest3 {http=">[*:POST:http://myserverip/index.html:on] " }
Switch myTest4 {http=">[*:POST:http://myserverip/index.html:MAP(] " }

I can see the following DEBUG logs when switching

00:21:54.829 [DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url 'http://myserverip/index.html?cmd=ON' via method POST
00:21:55.527 [DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url 'http://myserverip/index.html?cmd=OFF' via method POST
00:23:59.783 [DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url 'http://myserverip/index.html' via method POST, with body content 'default'
00:24:09.821 [DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url 'http://myserverip/index.html' via method POST, with body content 'on'
00:24:12.542 [DEBUG] [ab.binding.http.internal.HttpBinding] - Executing url 'http://myserverip/index.html' via method POST, with body content 'MAP('

Instead of body content ‘default’ I would expect ON or OFF, and certainly there is a, and I did install Map service, it works as expected when using it in an item label, so I would expect the transformation string.

EDIT: forgot to mention (sorry):
I’m running openHAB2 from debian repository,
debian is: stretch (64bit)
java version is: Java™ SE Runtime Environment (build 1.8.0_131-b11)
OH2 version is: 2.2.0-SNAPSHOT Build #986

As this is the nightly version from today, I verified the behavior once more.

hi , are there any findings on this issue?

An issue was created. You can track the progress there.

I believe this fix is ready.

I have created a test jar from the code changes in my fork. It appears to be in good shape, but please test it rigorously.

hi, thank you! could you please guide me to install the jar? I will test the functionality next week.

Uninstall the existing plugin (via Karaf and/or UI) until it doesn’t start when OH does.
Drop the new jar in the addons folder.

hi, I can confirm. the fix is working and I’m able to control my zeptrion devices. I’ll test the addon during this week.

thank you so much!