This is a discussion on URL GET within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I want to make a call to a HTTP api, and retrieve the results, but don't want to go ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I want to make a call to a HTTP api, and retrieve the results, but don't
want to go to the trouble of doing a form post. How can I call http://domain.com/api?foo=bar and retrieve the result using PHP ? Thanks in advance. |
|
|||
|
"furry" <cbtsys@iol.ie> schreef in bericht news:bnbkbs$bgt$1@kermit.esat.net... > I want to make a call to a HTTP api, and retrieve the results, but don't > want to go to the trouble of doing a form post. > > How can I call http://domain.com/api?foo=bar and retrieve the result using > PHP ? > With one of the following: http://www.php.net/fopen http://www.php.net/file http://www.php.net/file_get_contents http://www.php.net/fsockopen JW |
|
|||
|
Janwillem Borleffs wrote:
> > "furry" <cbtsys@iol.ie> schreef in bericht > news:bnbkbs$bgt$1@kermit.esat.net... >> I want to make a call to a HTTP api, and retrieve the results, but don't >> want to go to the trouble of doing a form post. >> >> How can I call http://domain.com/api?foo=bar and retrieve the result >> using PHP ? >> > > With one of the following: Good starting points from Janwillem there, however I would also suggest looking into the PHP curl libraries, and the PEAR HTTP functions (I personally use the latter, I don't like curl, each to thier own) Kind Regards, -- Ian P. Christian http://www.fuzzmail.co.uk ~ Free, Fast and Fuzzy webmail |
|
|||
|
thanks guys. My host does not have PEAR installed, so I'll go with fopen
furry "Ian P. Christian" <pookey@pookey.co.uk> wrote in message news:bniv0u$p3b$2@goat.anlx.net... Janwillem Borleffs wrote: > > "furry" <cbtsys@iol.ie> schreef in bericht > news:bnbkbs$bgt$1@kermit.esat.net... >> I want to make a call to a HTTP api, and retrieve the results, but don't >> want to go to the trouble of doing a form post. >> >> How can I call http://domain.com/api?foo=bar and retrieve the result >> using PHP ? >> > > With one of the following: Good starting points from Janwillem there, however I would also suggest looking into the PHP curl libraries, and the PEAR HTTP functions (I personally use the latter, I don't like curl, each to thier own) Kind Regards, -- Ian P. Christian http://www.fuzzmail.co.uk ~ Free, Fast and Fuzzy webmail |