I have a shared server on 1and1. In my MVC site, when I try to connect to another server outside I get this error:
An error occurred while sending the request. Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 23.xxx.xxx.xxx:80
When I run it on my development machine locally it works fine, but when I upload it to server by FTP, it shows that error.
here is my code:
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("http://OutsideServer.com", UriKind.Absolute);
var url = "GetData";
var stringContent = string.Format("\"id\":12");
StringContent content = new StringContent(stringContent);
var result = await client.PostAsync(url, content);
var jsondata = await result.Content.ReadAsStringAsync();
in another question I found this answer:
<configuration>
<system.net>
<defaultProxy>
<proxy
usesystemdefault = "false"
proxyaddress="http://proxyserver"
bypassonlocal="true"
/>
</defaultProxy>
</system.net>
</configuration>
But I don't know what proxy address should be.