We have moved at community.getvera.com

Author Topic: Recieve HTTP Post  (Read 504 times)

Offline RitterIwan

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Recieve HTTP Post
« on: September 03, 2018, 07:04:51 am »
Hi everybody,

it is possible to reviece a Http-Post and parse the incoming JSON with some lua code?
I'm using a VERA Edge unit (UI7)

Besr regards

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Recieve HTTP Post
« Reply #1 on: September 05, 2018, 07:28:24 am »
Hi,

Yes you can. You will have to use the socket.http library. You can look here for an example https://github.com/reneboer/openLuup-CarNet/blob/master/src/L_CarNet1.lua. Look at lines 279 - 342.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline RitterIwan

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Re: Recieve HTTP Post
« Reply #2 on: September 09, 2018, 03:36:55 pm »
Hi Rene,

thanks a lot for answering.
So far I understand your code you will send something via POST.
But I need to recieve something.


Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Recieve HTTP Post
« Reply #3 on: September 10, 2018, 08:58:14 am »
You mean a post command to the Vera to get data of it? The wiki.mios.com documents requests but they are all get requests.  I have not seen anything for posts. Do you have control over the call application? Then you can change it to a GET request.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.