Created
August 12, 2016 14:42
-
-
Save chester89/4aa4dd3c5d5c9ba945318d00d63fbfad to your computer and use it in GitHub Desktop.
Better design for custom geocoding proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomGeocodeProxyProvider : IGeocodeProxyProvider | |
{ | |
private Uri baseUri; | |
public CustomGeocodeProxyProvider(string baseUrl) | |
{ | |
baseUri = new Uri(baseUrl); | |
} | |
public HttpWebRequest CreateRequest(string url) | |
{ | |
url = new UriBuilder(url) | |
{ | |
Host = baseUri.Host, | |
Port = baseUri.Port, | |
Scheme = baseUri.Scheme | |
}.Uri.ToString(); | |
return WebRequest.CreateHttp(url); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment