Welcome To Golang By Example

Menu
  • Home
  • Blog
  • Contact Us
  • Support this website
Menu

Canonical HTTP Header Key Meaning

Posted on November 30, 2020November 30, 2020 by admin

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

Content-Type
Accept-Encoding

All the keys in the headers are represented in the canonical form only. For eg if there are below headers in an incoming http request

content-type: applcation/json
accept-encoding: gzip

Then 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.

Content-Type: application/json
Accept-Encoding: gzip

Note that

  • content-type is converted to canonical form Content-Type
  • accept-encoding is converted to canonical form Accept-Encoding
Follow @golangbyexample

Popular Articles

Golang Comprehensive Tutorial Series

All Design Patterns in Go (Golang)

Slice in golang

Variables in Go (Golang) – Complete Guide

OOP: Inheritance in GOLANG complete guide

Using Context Package in GO (Golang) – Complete Guide

All data types in Golang with examples

Understanding time and date in Go (Golang) – Complete Guide

©2025 Welcome To Golang By Example | Design: Newspaperly WordPress Theme