Overview

A simple Get request in CSharp

Note- Use https:// in the url.

using System;
using System.Net;
using System.IO;

public class Program
{
    public static void Main()
    {
        string remoteUrl = string.Format("https://unfurl.io/api/v2/preview?api_token=yourapitoken&url=https://www.google.com");
        HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(remoteUrl);
        WebResponse response = httpRequest.GetResponse();
        StreamReader reader = new StreamReader(response.GetResponseStream());
        string result = reader.ReadToEnd();
        Console.WriteLine(result);
    }
}