Is Vera able to receive a http POST ?

I used Luup requests a lot these last year (http://wiki.micasaverde.com/index.php/Luup_Requests) in order to trigger action in my Vera communicated by other devices (FreePbx, IPX800, ?)

As fas as I understand (?), these requests are send as http GET message to Vera and read as such.

I have now a device (Grandstream GDS3710) that can only transmit events as http POST to the Vera. The extra difficulty is that in Post message, the parameters are in the body/payload of the message.

Is someone aware of a way to trigger action in vera and read parameters transmitted in the POST http message ?

Thanks for your help :slight_smile:

To explain a bit further, here is the result of the POST request sent by my device (GDS3710)?

Do you see a possibility to have this understood by the Vera API ?

Thanks !


Hypertext Transfer Protocol
POST / HTTP/1.1\r\n
User-Agent: Wget/1.16 (linux-gnueabihf)\r\n
Accept: /\r\n
Host: 192.168.1.37:8000\r\n
Connection: Keep-Alive\r\n
Content-Type: application/x-www-form-urlencoded\r\n
Content-Length: 105\r\n
\r\n
[Full request URI: http://192.168.1.37:8000/]
[HTTP request 1/1]
File Data: 105 bytes

HTML Form URL Encoded: application/x-www-form-urlencoded
Form item: “id” = “lu_action”
Form item: “DeviceNum” = “91”
Form item: “serviceId” = “urn:upnp-org:serviceId:SwitchPower1”
Form item: “action” = “SetTarget”
Form item: “newTargetValue” = “1”

Try with http handlers. AFAIK you can access parameters via POST, but can’t find the exact code right now.

http://forum.micasaverde.com/index.php/topic,39814.msg296454.html#msg296454

Hello therealdb.

If I understand correctly, these http handlers are a solution to transmit parameters to a lua scene via the url.

My problem is that with the post message sent by my device, it seems I am not able to perfom any lua action at all…

No, these are a way to execute any code you want.
You can post any Parameter and then execute some Lua code to change your desired variable.

I have been able to define a new handler mfh for function MyFirstHandler and to launch it using a http url in my browser http://Vera_IP:3480/data_request?id=lr_mfh

But when i try to put the same url in my device that send a http POST, nothings :frowning:

Here is a screenshot of my device interface if it gives idea to someone…

The device is of course on the same network than the Vera…

Hi,

The build in handler is only for GET requests. You can add parameters to the GET URL and parse those in your handler. Here is an example [url=https://github.com/reneboer/vera-Harmony-Hub/blob/master/chm-ludl/L_Harmony.lua]https://github.com/reneboer/vera-Harmony-Hub/blob/master/chm-ludl/L_Harmony.lua[/url] starting at line 1114.

Cheers Rene

Thanks Rene, I will investigate if I can use this in my POST url. As it seems it is a bit beyond my level, it will get me busy sometimes :slight_smile: