package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://dink.ga/api/criarURL"
payload := strings.NewReader("{\n\t\"url\": \"https://example.com\"\n}")
req, _ := http.NewRequest("POST" url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter