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

https://github.com/mrpollo/geocoding-api


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -