title: Exception thrown: 'System.Net.WebException' in System.dll
body: <p>In the button click event of below code, I'm able to send my data to post action of API Controller now.<br>
  <strong>Button Click Event of Windows Form</strong></p>
  
  <pre><code> private void button1_Click(object sender, EventArgs e)
      {
          WebClient client = new WebClient();
          client.Headers[HttpRequestHeader.ContentType] = "application/json";
          MyClass myClass = new MyClass();
          myClass.SearchText = textBox1.Text;
          myClass.CountryCode = textBox2.Text;
          string serialisedData = JsonConvert.SerializeObject(myClass);
          var response = client.UploadString("http://localhost:50232/api/Place/PostSimple", serialisedData);
          var x= JsonConvert.DeserializeObject(response);
      }
  }
  public class MyClass
  {
      public string SearchText { get; set; }
      public string CountryCode { get; set; }
  }
  </code></pre>
  
  <p>But while debugging, I'm not able to move after </p>
  
  <pre><code>GeocodingResponse geocode = GoogleMaps.Geocode.Query(geocodeRequest); 
  </code></pre>
  
  <p>this line of PostSimple action method. and getting the exception in </p>
  
  <pre><code> var response = client.UploadString("http://localhost:50232/api/Place/PostSimple", serialisedData); of Windows form application as
  </code></pre>
  
  <p><em>Exception thrown: 'System.Net.WebException' in System.dll</em></p>
  
  <p><em>Additional information: The operation has timed out</em></p>
  
  <p><strong>ApiController Code</strong></p>
  
  <pre><code>[HttpPost]
      public List&lt;Place&gt; PostSimple(MyClass value)
      {
          List&lt;Place&gt; list = new List&lt;Place&gt;();
          var geocodeRequest = new GeocodingRequest
          {
             Address = value.SearchText,
             Components = new GeocodingComponents()
              {                   
                  Country = value.CountryCode
              }
          };
          try
          {
              GeocodingResponse geocode = GoogleMaps.Geocode.Query(geocodeRequest);
              if (geocode.Status == GoogleMapsApi.Entities.Geocoding.Response.Status.OK)
              {
                  TimeZoneRequest request = new TimeZoneRequest();
                  request.Location = new Location(geocode.Results.First().Geometry.Location.Latitude, geocode.Results.First().Geometry.Location.Longitude);
                  request.Language = "en";
                  request.TimeStamp = DateTime.Now.AddDays(-60);
                  TimeZoneResponse result = GoogleMaps.TimeZone.Query(request);
                  var x = System.TimeZoneInfo.FindSystemTimeZoneById(result.TimeZoneName);
              }
          }
          catch (Exception ex)
          {
              throw ex;
          }
         return list;
      }
  </code></pre>
  
  <p><strong>MyClass code</strong></p>
  
  <pre><code>public class MyClass
  {
      public string SearchText { get; set; }
      public string CountryCode { get; set; }
  }
  </code></pre>
  
  <p>Can anyone help me to solve this issue..Thanks in Advance</p>
  
  <p><a href="https://i.stack.imgur.com/W33x1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W33x1.png" alt="enter image description here"></a></p>