How to add a simple HTTP GET request?
#1
Hi,

I just bought an AV Receiver which has a webinterface.
I had the idea of modifying slightly some of the JSON methods of xbmc to add a call to the specific url of my receiver to trigger the correct input source and to switch it ON.
The goal is to be able to use the webinterface of XBMC to select a song or a movie and to get XBMC switching ON my receiver and put the correct input.

I already got this working by modifying the default XBMC webinterface, but I also would like to have the same behavior if I use an iPhone XBMC remote for instance. That's why I think that the solution is to directly modify the sources of the XBMC JSON methods.

It should be pretty obvious but I can't find the correct syntax in C++ (using CURL I guess) to just open a http get connection to a specific URL.

Can someone please help me with this ?
Reply
#2
see CFileCurl (specifically ::Get()) xbmc/filesystem/FileCurl.h|cpp

CURL is our url container class, not Curl Smile
Reply
#3
Thank you. Thats works ! Smile

Code:
XFILE::CFileCurl avcurl;
  CStdString resulthtml=" ";
  CStdString urlon="http://192.168.1.93/MainZone/index.put.asp?cmd0=PutSystem_OnStandby/ON";
  CStdString urlsource="http://192.168.1.93/QuickSelect/index.put.asp?cmd0=PutUserMode/Quick2";
  avcurl.Get(urlon, resulthtml);
  avcurl.Get(urlsource, resulthtml);

in PlayerOperations.cpp
(for a Denon 1912)
Reply

Logout Mark Read Team Forum Stats Members Help
How to add a simple HTTP GET request?0