What are Content-Language and Accept-Language?

后端 未结 5 1568
星月不相逢
星月不相逢 2020-12-01 02:12

I have seen the HTTP headers of Content-Language and Accept-Language, could someone explain what these are for and the difference between them? I h

5条回答
  •  借酒劲吻你
    2020-12-01 03:07

    The Content-Language entity header is used to describe the language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language.

    Header type                     Entity header
    Forbidden header name           no
    CORS-safelisted response-header yes
    CORS-safelisted request-header  yes
    

    — MDN Web Reference - HTTP Headers - Content-Language

    The Accept-Language request HTTP header advertises which languages the client is able to understand, and which locale variant is preferred. (By languages, we mean natural languages, such as English, and not programming languages.)

    Header type                     Request header
    Forbidden header name           no
    CORS-safelisted request-header  yes
    

    — MDN Web Reference - HTTP Headers - Accept-Language

提交回复
热议问题