Skip to content

Instantly share code, notes, and snippets.

@menuka94
Last active August 8, 2017 08:23
Show Gist options
  • Save menuka94/3340f8f57ba7a5c90476c2c1f4a17086 to your computer and use it in GitHub Desktop.
Save menuka94/3340f8f57ba7a5c90476c2c1f4a17086 to your computer and use it in GitHub Desktop.
Go - HTTP Requests
// https://stackoverflow.com/questions/40006631/sending-post-request-in-golang-with-header
package main
import (
"fmt"
"net/http"
"crypto/tls"
)
func main() {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
_, err := client.Get("https://golang.org/")
if err != nil {
fmt.Println(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment