Overview

A simple Get request in GO (GoLang)

Note- Use https:// in the url.

package main
import (
    "io/ioutil"
    "log"
    "net/http"
)

func main() {
    resp, err := http.Get("https://unfurl.io/api/v2/preview?api_token=yourapitoken&url=https://www.google.com")
    if err != nil {
        log.Fatalln(err)
    }
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        log.Fatalln(err)
    }
    log.Println(string(body))
}