Copy link to clipboard
Copied
I am trying to get a response from google's maps api with code. I get the result I want when I paste something like http://maps.google.com/maps/geo?q=40.714224,-73.961452&output=xml&oe=utf8&sensor=false&key=mykey123 into a browser.
But I want to do it with cf code.
The result is returned in xml format.
Copy link to clipboard
Copied
Figured it out
<!--- Set the query path --->
<cfset qmap=http://maps.google.com/maps/geo?q=40.714224,-73.961452&output=js&oe=utf8&sensor=false&key=123>
<!--- Use cfhttp to get the info from google maps --->
<cfhttp method="get"
url="#qmap#"
resolveurl="no">
</cfhttp>
<cfset string=#cfhttp.filecontent#>
<cfdump var="#string#">