Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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