in Source/Requests/GeocodeRequest.cs [85:150]
public override string GetRequestUrl()
{
var sb = new StringBuilder(this.Domain);
sb.Append("Locations");
if (!string.IsNullOrWhiteSpace(Query))
{
sb.AppendFormat("?q={0}", Uri.EscapeDataString(Query));
}
else if (Address != null)
{
string seperator = "?";
if (!string.IsNullOrWhiteSpace(Address.AddressLine))
{
sb.AppendFormat("{0}addressLine={1}", seperator, Uri.EscapeDataString(Address.AddressLine));
seperator = "&";
}
if (!string.IsNullOrWhiteSpace(Address.Locality))
{
sb.AppendFormat("{0}locality={1}", seperator, Uri.EscapeDataString(Address.Locality));
seperator = "&";
}
if (!string.IsNullOrWhiteSpace(Address.AdminDistrict))
{
sb.AppendFormat("{0}adminDistrict={1}", seperator, Uri.EscapeDataString(Address.AdminDistrict));
seperator = "&";
}
if (!string.IsNullOrWhiteSpace(Address.PostalCode))
{
sb.AppendFormat("{0}postalCode={1}", seperator, Uri.EscapeDataString(Address.PostalCode));
seperator = "&";
}
if (!string.IsNullOrWhiteSpace(Address.CountryRegion))
{
sb.AppendFormat("{0}countryRegion={1}", seperator, Uri.EscapeDataString(Address.CountryRegion));
}
}
else
{
throw new Exception("No Query or Address value specified.");
}
if (IncludeIso2)
{
sb.Append("&incl=ciso2");
}
if (IncludeNeighborhood)
{
sb.Append("&inclnb=1");
}
if (maxResults != 5)
{
sb.AppendFormat("&maxResults={0}", maxResults);
}
sb.Append(GetBaseRequestUrl());
return sb.ToString();
}