php - yahoo maps api curl settings -
how should configure curl retrieve data yahoo maps api?
here current code
curl_setopt($ch, curlopt_timeout, 5000); curl_setopt($ch, curlopt_url, $geocodeurl); curl_setopt($ch, curlopt_returntransfer, true); $data = curl_exec($ch);
which returns 400 - bad request html file. i've checked $geocodeurl
, valid xml file, figure problem must curl options?
$geocodeurl is
http://where.yahooapis.com/geocode?appid=** app id **&q=battle%20creek,mi&gflags=r
i wrote simple class wrapper basic address php object, might job done! added google geocoding wrapper.
to answer question, ok url posted, yes mentioned on reply should urlencode params
$query = $this->url."?appid=".$this->appid."&flags=".$this->format; $query .= "&location=".urlencode($address);
here link wrapper class
Comments
Post a Comment