Tuesday

3rd of January, 2012

Permalink / Short Url

Remember to set WebRequest.Proxy=null, kids!

Was playing around with Google’s geocoder api using .NET’s WebRequest and WebResponse to get the JSON data back to my app.

All by itself, Google’s service is extremely fast, of course, but in my app, it was taking anywhere from 3s-16s to retrieve, and parse the JSON into POCOs. Not cool bro.

Turns out, I just needed to set the Proxy property on my WebRequest object to null, and now it’s returning sub-half-second responses to request, retrieve and parse the JSON. Thank, FSM, I was going mad!

Have a gist.