reverse geocoding using nominatim in asp.net

Viewed 6481

I'm using nominatim for reverse geocoding in my asp.net website (Visual Studio 2010, C#).

I'm getting answer in XML or json format on another webpage like below:

I cant read this address using XML reader or HTTP response.

Need help to convert this text into plain text and displaying on my website.

3 Answers

To complement the example given by Vladimir Gondarev, Nominatim currently does not accept requests without Referer and User-Agent. That way, just add these two lines:

webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
webClient.Headers.Add("Referer", "http://www.microsoft.com");

(Modify to your liking).

Related