Created
January 31, 2020 05:04
-
-
Save drtaka/8e0b3b790a0e82329bb4ff1e0b48557e to your computer and use it in GitHub Desktop.
This file contains 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
package main | |
import ( | |
"net/http" | |
"os" | |
"log" | |
) | |
/** | |
http.Request はクライアント、サーバ両方で使える。 | |
*/ | |
func main() { | |
req, err := http.NewRequest("GET", "http://example.com", nil) | |
if err != nil { | |
log.Fatal(err) | |
} | |
req.Header.Set("X-TEST", "add custom header") | |
req.Write(os.Stdout) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment