c# - error geocoding API -


i trying use google geocoding. if type

https://maps.googleapis.com/maps/api/geocode/json?address=1600+amphitheatre+parkway,+mountain+view,+ca&sensor=true 

it gives me right output. trying use amazon proxy server , gives

{ "error_message" : "the 'sensor' parameter specified in request must set either 'true' or 'false'.", "results" : [], "status" : "request_denied" } 

this code

http://ec2-00-000-000-000.compute-1.amazonaws.com/osproxy/getpage.aspx?p=https://maps.googleapis.com/maps/api/geocode/json?address=1600+amphitheatre+parkway,+mountain+view,+ca&sensor=true 

can me?

thanks rashmi

you need url-encode parameters. consider url you're using:

http://ec2-00-000-000-000.compute-1.amazonaws.com/osproxy/getpage.aspx?p=https://maps.googleapis.com/maps/api/geocode/json?address=1600+amphitheatre+parkway,+mountain+view,+ca&sensor=true 

this parsed as:

http://ec2-00-000-000-000.compute-1.amazonaws.com/osproxy/getpage.aspx?     p=https://maps.googleapis.com/maps/api/geocode/json?address=1600+amphitheatre+parkway,+mountain+view,+ca&     sensor=true 

that is, you're passing sensor parameter amazonws.com, not googleapis.com.

since parameter amazonws.com should full url, encode url reaches amazonws.com single parameter passed through googleapis.com:

http://ec2-00-000-000-000.compute-1.amazonaws.com/osproxy/getpage.aspx?p=https%3a%2f%2fmaps.googleapis.com%2fmaps%2fapi%2fgeocode%2fjson%3faddress%3d1600%2bamphitheatre%2bparkway%2c%2bmountain%2bview%2c%2bca%26sensor%3dtrue 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -