{"id":4595,"date":"2020-11-30T11:10:02","date_gmt":"2020-11-30T05:40:02","guid":{"rendered":"https:\/\/golangbyexamples.com\/?p=4595"},"modified":"2020-11-30T11:10:08","modified_gmt":"2020-11-30T05:40:08","slug":"canonical-http-header-key","status":"publish","type":"post","link":"https:\/\/golangbyexamples.com\/canonical-http-header-key\/","title":{"rendered":"Canonical HTTP Header Key Meaning"},"content":{"rendered":"\n
Canonical form means that first character and after that any character following a hyphen is in uppercase. All other characters will be in lowercase. Example of canonical forms are<\/p>\n\n\n\n
Content-Type\nAccept-Encoding<\/code><\/pre>\n\n\n\nAll the keys in the headers are represented in the canonical form only. For eg if there are below headers in an incoming http\u00a0request<\/p>\n\n\n\n
content-type: applcation\/json\naccept-encoding: gzip<\/code><\/pre>\n\n\n\nThen at server most of the http library in different languages at server will interpret it in the canonical form. For example the above headers will be as below when we print headers at server end.<\/p>\n\n\n\n
Content-Type: application\/json\nAccept-Encoding: gzip<\/code><\/pre>\n\n\n\nNote that<\/p>\n\n\n\n
- content-type<\/strong> is converted to canonical form Content-Type<\/strong><\/li><\/ul>\n\n\n\n
- accept-encoding<\/strong> is converted to canonical form Accept-Encoding<\/strong><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"
Canonical form means that first character and after that any character following a hyphen is in uppercase. All other characters will be in lowercase. Example of canonical forms are All the keys…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"class_list":["post-4595","post","type-post","status-publish","format-standard","hentry","category-tech"],"yoast_head":"\n
Canonical HTTP Header Key Meaning - Welcome To Golang By Example<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n