How can I make an HTTP request in php? I tried http_get and http_request functions and it I get an error, call to undefined function.
Is there any simple way to return the RSS XML from yahoo weather? I'm trying to return the XML of yahoo weather and then use XML functions on the feed and then return a sorta textual/JSON format of the data of my choosing.
I just need a simple way to get the response of "http://weather.yahooapis.com/forecastrss?p=94089&u=c".
Thanks for reading, all help is appreciated on this.
Making an HTTP request.
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Making an HTTP request.
cURL or if you don't have that installed then the Snoopy class is really good.
(#10850)
- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
Re: Making an HTTP request.
If you're using PHP5 and all you need is a GET request, you can simply do:
Code: Select all
$response = file_get_contents('http://someserver.com/some/path?some=params');
Re: Making an HTTP request.
Wowy the cURL lib works great.
The only other problem I'm having is the XML parsing side. Or would this require another topic.
Btw I'm using php 4 so no new stuff for me.
The only other problem I'm having is the XML parsing side. Or would this require another topic.
Btw I'm using php 4 so no new stuff for me.