2008-09-24, 16:48
My problem is kind of hard to describe in the title... so here's the full description.
I'm writing a media controller for the XBMC xbox version in C++. It will be a Winamp-like tool that will make it possible to control what is playing on the XBOX like you are playing it locally on your windows pc. I've just started and I've already spend some day's figuring out what is going wrong. It's most likely a problem with the library I'm using to do http request, but maybe someone here can give me some insight in the reason why it's not working as you'd expect.
I'm using the Indy Sockets lib, which is great, to do the requests. It works pretty straight forward. I open en a url with a Get request and the method returns the content of the page in string... i.a.
Now I can open every page I want on the xbox or the internet and the "pageContent" var will contain the source of the requested page. Except for the pages I need! So if I request the "http://<xbox-ip>/default.asp" page, it will return the content of the webinterface perfectly. But no matter what command I run on "http://<xbox-ip>/xbmcCmds/xbmcHttp?command=" ..... it returns an empty string..... always. Even though when I request the exact same page with my browser I get the result you'd expect. I really don't get it.
Can anyone help me understand what the problem is?
I'm writing a media controller for the XBMC xbox version in C++. It will be a Winamp-like tool that will make it possible to control what is playing on the XBOX like you are playing it locally on your windows pc. I've just started and I've already spend some day's figuring out what is going wrong. It's most likely a problem with the library I'm using to do http request, but maybe someone here can give me some insight in the reason why it's not working as you'd expect.
I'm using the Indy Sockets lib, which is great, to do the requests. It works pretty straight forward. I open en a url with a Get request and the method returns the content of the page in string... i.a.
Code:
AnsiString pageContent = IdHTTP1->Get("http://<xbox-ip>/xbmcCmds/xbmcHttp?command=GetCurrentlyPlaying");
Now I can open every page I want on the xbox or the internet and the "pageContent" var will contain the source of the requested page. Except for the pages I need! So if I request the "http://<xbox-ip>/default.asp" page, it will return the content of the webinterface perfectly. But no matter what command I run on "http://<xbox-ip>/xbmcCmds/xbmcHttp?command=" ..... it returns an empty string..... always. Even though when I request the exact same page with my browser I get the result you'd expect. I really don't get it.
Can anyone help me understand what the problem is?