Last active
August 8, 2017 08:23
-
-
Save menuka94/3340f8f57ba7a5c90476c2c1f4a17086 to your computer and use it in GitHub Desktop.
Go - HTTP Requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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