title: Local webservice can not connect to android emulator
body: <p>i use vs2015 , webapi web service and xamarin.Android</p>
  
  <p>i create a solution with 2 projects</p>
  
  <p>1- project is web Api
  2- is xamarin.android project</p>
  
  <p>in Web API project i have a Url (<a href="http://localhost:27635/api/books/1/details" rel="nofollow">http://localhost:27635/api/books/1/details</a>)
  and this return details of book like this</p>
  
  <pre><code>{"query":{"Title":"Midnight Rain","Genre":"Fantasy","PublishDate":"2000-12-16T00:00:00","Description":"A former architect battles an evil sorceress.","Price":14.95,"Author":"Ralls, Kim"}}
  "}
  </code></pre>
  
  <p>and in xamarin project:
  I used this code for consuming web api project
  public class MainActivity : Activity
  {</p>
  
  <pre><code>    protected override void OnCreate(Bundle bundle)
      {
          base.OnCreate(bundle);
  
          // Set our view from the "main" layout resource
          SetContentView(Resource.Layout.Main);
  
     :
          Button button = FindViewById&lt;Button&gt;(Resource.Id.getWeatherButton);
  
          // When the user clicks the button ...
          button.Click += async (sender, e) =&gt; {
  
              // Get the latitude and longitude entered by the user and create a query.
              string url = "http://localhost:8080/api/books/1/details";
              //string url = "http://169.254.129.9/api/books/1/details";
  
              // Fetch the information asynchronously, 
              // parse the results, then update the screen:
              JsonValue json = await FetchWeatherAsync(url);
              ParseAndDisplay(json);
          };
      }
      // Gets data from the passed URL.
      private async Task&lt;JsonValue&gt; FetchWeatherAsync(string url)
      {
          // Create an HTTP web request using the URL:
          HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri(url));
          request.ContentType = "application/json";
          request.Method = "GET";
  
          // Send the request to the server and wait for the response:
          using (WebResponse response = await request.GetResponseAsync())
          {
              // Get a stream representation of the HTTP web response:
              using (Stream stream = response.GetResponseStream())
              {
                  // Use this stream to build a JSON document object:
  
  
                     JsonValue jsonDoc = await Task.Run(() =&gt; JsonObject.Load(stream));
                      Console.Out.WriteLine("Response: {0}", jsonDoc.ToString());
  
                      // Return the JSON document:
                      return jsonDoc;
  
                  }
              }
          }
          // Parse the weather data, then write temperature, humidity, 
  private void ParseAndDisplay(JsonValue json)
          {
              TextView location = FindViewById&lt;TextView&gt;(Resource.Id.locationText);
  
  
              JsonValue weatherResults = json["query"];
  
  
              location.Text = weatherResults["Title"];
  
          }
      }
  </code></pre>
  
  <p>When I use my local webapi project , Below code will not be executed and Local webservice can not connect to android emulator for get data from web service, and get me a error</p>
  
  <pre><code>using (Stream stream = response.GetResponseStream())
  {
   // Use this stream to build a JSON document object:
   JsonValue jsonDoc = await Task.Run(() =&gt; JsonObject.Load(stream));
  Console.Out.WriteLine("Response: {0}", jsonDoc.ToString());
  // Return the JSON document:
  return jsonDoc;
  }
  </code></pre>
  
  <p>But,When I use an external web api is working correctly</p>