Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Storing parameters passed to webserver as a variable.

Questions and comments specific to a particular plugin should go here.
Post Reply
vader88
Posts: 9
Joined: Wed Apr 27, 2011 1:03 am

Storing parameters passed to webserver as a variable.

Post by vader88 »

I would like to use the webserver plugin to play a file on my PC that is specified by the url.

For example I want to trigger this URL:

Code: Select all

http://192.168.0.10:82?playfile=&filename=test.mkv
And the playfile parameter would trigger the event and I could retrieve the filename to pass along to the action.

When I call the URL it shows up in eventghost like this:

Code: Select all

HTTP.playfile [u'filename=test.mkv']
How do I access the value of filename?
vader88
Posts: 9
Joined: Wed Apr 27, 2011 1:03 am

Re: Storing parameters passed to webserver as a variable.

Post by vader88 »

After a lot of searching and playing around I have figured out that what I was searching for was

Code: Select all

eg.event.payload
That variable contains the extra data sent via the webserver. Now I just have to parse it out which should be easy.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Storing parameters passed to webserver as a variable.

Post by krambriw »

Code: Select all

file_to_play = eg.event.payload.split('=')[1]
Post Reply