All Products
Search
Document Center

Function Compute:Why is the initial letter of a header key capitalized when I call an HTTP trigger?

Last Updated:Jun 11, 2024

HTTP headers are displayed in the form of key-value pairs. According to HTTP specifications, keys of headers are case-insensitive.

When you invoke a function that runs in a standard runtime by using an HTTP trigger, Function Compute 3.0 converts the HTTP request into the event format specific to HTTP triggers. When the HTTP header is converted, the key of the HTTP request header is normalized based on the net/http standard library.

The principle of normalization is to capitalize initial letters of keys and letters after hyphens and convert other letters to lowercase. For example, "accept-encoding" is normalized to "Accept-Encoding".