XML/API cannot be retrieved by PHP/curl

Hutiourinic

New Member
Yeah, I'm stumped. I'm getting nothing. curl_exec is returning no content. I've tried file_get_contents, but that completely times out. I'm attempting to get an API XML from my Subsonic media server and display it on my web server (different servers). The end result would be that I can have people log in to my web server with the media server account. I can deal with the actual parsing later, but I can't even grab the XML right now. I've tried their forums, but haven't gotten much help since they're not really PHP inclined. Figure I'd ask here.\[code\]$url = "http://{$subserver}/rest/getUser.view?u={$username}&p={$password}&username={$username}&v=1.8.0&c={$appID}";$c = curl_init($url);curl_setopt($c, CURLOPT_RETURNTRANSFER, true);curl_setopt($c, CURLOPT_HEADER, 0);$result = curl_exec($c);curl_close($c);echo $result;\[/code\]This returns nothing. The variables are defined correctly, and I get the same response as if I typed in the whole URL. Here is their API page: http://www.subsonic.org/pages/api.jsp I've even tried with their "ping" function - still emptyThe url itself looks fine. In the web browser, it returns:\[code\]This XML file does not appear to have any style information associated with it. The document tree is shown below.<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.8.0"><user username="xxxxxx" email="[email protected]" scrobblingEnabled="false" adminRole="true" settingsRole="true" downloadRole="true" uploadRole="true" playlistRole="true" coverArtRole="true" commentRole="true" podcastRole="true" streamRole="true" jukeboxRole="true" shareRole="true"/></subsonic-response>\[/code\]I admit I've never used XML, but according to everything I've read... this should work. And it does work, with other random XML files I found on the web.it might have something to do with the fact that it's not an ".xml" file, but a generated via url xml, as this same exact code will work with some random xml file I found ( http://www.w3schools.com/xml/note.xml )Any thoughts?
 
Back
Top