I am making an API which responds to incoming requests by returning xml files. So for example if I go to:
[url]http://localhost/fpapi/fpapi.php?method=film.getTop
I get an xml file:
<fpapiresponse type=”success”>
<film>
<id>10875721</id>
<title>Moon</title>
<tagline>The last place you’d ever expect to find yourself</tagline>
<description>Astronaut Sam Bell has a qui…
…
It works fine in this mode of operation, but I need to be able to make requests to the API from within a PHP script. That is, I need to be able to open the url above and read the contents of the returned xml file so that I can the data in the PHP script.
Following ‘Example #1’ from [url]http://uk.php.net/manual/en/context.http.php
It just times out. Is the server is making a request to itself? Or is it because I am making the request in the wrong way?
Please ask any further questions if you need me to clarify anything.
Thanks, this is a major problem for me which I really had not anticipated ?