I am trying a Windows 8 App which gets source code of a webpage and extract some important data. But I am receiving this when getStringAsync
function get called.
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 173.194.41.64:443 at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
Here is the code
const string feedUrl = "https://google.com";
HttpClient Client = new HttpClient();
Client.MaxResponseContentBufferSize = int.MaxValue;
Client.Timeout = System.TimeSpan.FromSeconds(300);
var source = await Client.GetStringAsync(feedUrl);