The remote name could not be resolved error when calling API from server <p>On my website I have some calls to an API.</p> <p>In client side, with AJAX, it works perfectly but from server side (MVC and C#) I'm getting the following error: </p> <blockquote> <p>The remote name could not be resolved 'api.website.com'</p> </blockquote> <p>This is the code that calls the API:</p> <pre><code>JsonSerializerSettings settings = new JsonSerializerSettings(); settings.ContractResolver = new CamelCasePropertyNamesContractResolver(); var data = JsonConvert.SerializeObject(email); WebClient client = new WebClient(); client.Headers.Add(HttpRequestHeader.ContentType, "application/json"); var resp = client.UploadString(@"http://api.website.com/functions/email", data); </code></pre> <p>Any help would be very much appreciated.</p>