Golang net/http.CanonicalHeaderKey() function example
package net
Golang net/http.CanonicalHeaderKey() function usage example
package main
import (
"fmt"
"net/http"
)
func main() {
str := "access-control-allow-origin"
newStr := http.CanonicalHeaderKey(str)
fmt.Println(newStr)
}
Output :
Access-Control-Allow-Origin
References :
http://golang.org/pkg/net/http/#CanonicalHeaderKey
List of common headers
"accept"
"accept-charset"
"accept-encoding"
"accept-language"
"accept-ranges"
"age"
"access-control-allow-origin"
"allow"
"authorization"
"cache-control"
"content-disposition"
"content-encoding"
"content-language"
"content-length"
"content-location"
"content-range"
"content-type"
"cookie"
"date"
"etag"
"expect"
"expires"
"from"
"host"
"if-match"
"if-modified-since"
"if-none-match"
"if-unmodified-since"
"last-modified"
"link"
"location"
"max-forwards"
"proxy-authenticate"
"proxy-authorization"
"range"
"referrer"
"refresh"
"retry-after"
"server"
"set-cookie"
"strict-transport-security"
"transfer-encoding"
"user-agent"
"vary"
"via"
"www-authenticate"
Advertisement
Something interesting
Tutorials
+5.8k Linux/Unix/PHP : Restart PHP-FPM
+4.7k JavaScript : Rounding number to decimal formats to display currency
+18.7k Golang : Find IP address from string
+9.6k Golang : Accessing content anonymously with Tor
+14.2k Javascript : Prompt confirmation before exit
+11.6k Use systeminfo to find out installed Windows Hotfix(s) or updates
+28.7k Get file path of temporary file in Go
+12.2k Golang : Detect user location with HTML5 geo-location
+6.4k Golang : Test input string for unicode example
+6.6k Golang : Convert an executable file into []byte example
+8.4k Golang : Check if integer is power of four example