title: How to call Bing Maps REST service using NuGet Bing.RestClient
body: <p>I want to use NuGet called Bing.RestClient v0.8 beta 1, in Visual Studio 2017, but I have no clue how to use it in Windows Forms to get Location (Latitude/Longitude).</p>
  
  <p>I am not familiar with REST services yet.</p>
  
  <p>Any code example that can help me to structure the project and understand how it works?</p>
  
  <p>I have tried with a web client and I can get the TEXT response that I may parse, but I want to use the classes available in the NuGet <code>Bing.RestClient</code>.</p>
  
  <pre><code>public partial class Form1 : Form
  {
      // PERSONAL BING KEY
      String BingKey = "*******************************";
  
      public Form1()
      {
          InitializeComponent();
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          GetFind();
      }
  
      private async void  GetFind()
      {
  
          // Take advantage of built-in Point of Interest groups
          var list = PoiEntityGroups.Government();
          list.Add(PoiEntityTypes.Bank);
          // Build your filter list from the group.
          var filter = PoiEntityGroups.BuildFilter(list);
          var client = new Bing.SpatialDataClient(BingKey);
  
          //---------------------------------------------------------
          // This does NOT use the Nuget but just a WebClient and I get the response in TEXT format. But this is not what I want.
          String AddressQuery = "Via Ravenna 10, Milano";
          String BaseQueryURL;
          BaseQueryURL = String.Format("http://dev.virtualearth.net/REST/v1/Locations?query={0}?maxResults=1&amp;key={1}", AddressQuery, BingKey);
  
          // Create web client simulating IE6.
          using (System.Net.WebClient wclient = new WebClient())
          {
              wclient.Headers["User-Agent"] = "Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0)";
  
              byte[] arr = wclient.DownloadData(BaseQueryURL);
              txtResult.Text = "Bytes: " + arr.Length + Environment.NewLine;
              txtResult.Text = txtResult.Text + wclient.DownloadString(BaseQueryURL);
          }
          //---------------------------------------------------------
      }
  }
  </code></pre>
  
  <p>I'm expecting to get the result deserialized by using the NuGet classes, but I don't know how to use them to get my Latitude and Longitude, querying by address.</p>