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
+9.1k Golang : Resolve domain name to IP4 and IP6 addresses.
+12.6k Golang : How to convert a number to words
+17.1k Golang : Send email with attachment
+6.6k Gogland : Where to put source code files in package directory for rookie
+14.1k Golang : How to add color to string?
+9.5k Golang : Replace a parameter's value inside a configuration file example
+22k Golang : minus time with Time.Add() or Time.AddDate() functions to calculate past date
+13.7k Golang : Basic authentication with .htpasswd file
+13.4k Golang : Rename directory
+23.3k Golang : convert rune to integer value
+6.2k Golang : How to stop user from directly running an executable file?
+7.5k Golang : Executing and evaluating nested loop in html template