慕桂英3389331
r.Header.Get("Accept-Language")就是你要找的。该函数将返回如下内容:en-US,en;q=0.8,ro;q=0.6func main() { http.HandleFunc("/", index) err := http.ListenAndServe(":8080", nil) if err != nil { log.Fatal("Error happend", err) }}func index(w http.ResponseWriter, r *http.Request) { if r.Method == "GET" { fmt.Println(r.Header.Get("Accept-Language")) }}而对应的$_SERVER['HTTP_ACCEPT_LANGUAGE']php函数也会返回同样的信息:en-US,en;q=0.5.