What is the difference between HTTP parameters and HTTP headers?

前端 未结 2 2256
花落未央
花落未央 2021-02-19 17:59

I read this question but it didn\'t answer my question.

To me Headers and Parameters are both dictionaries with the difference that headers is [String : String]

2条回答
  •  不知归路
    2021-02-19 18:33

    Here is the list of differences:

    1. They are designed for different purposes. Headers carry meta info, parameters carry actual data.

    2. Server side will automatically un-escape/decode parameter names/values. This does not apply for header names/values.

    3. Header names/values need to be manually escaped/encoded at client side and be manually un-escaped/decoded at server side. Base64 encoding or percent escape is often used.

    4. Parameters can be seen by end-users (query parameters) on URL but headers are hidden to end-users.

提交回复
热议问题