服务器常见的字段

95 阅读1分钟

服务器常见的字段?

  • host 字段

    • 指定域名
  • content-length

    • 本次回应的数据长度
  • connection

    • 常用于 tcp 持久连接
    • GET/HTTP/1.1
    • Connection: Keep-Alive
    • 1.1 默认持久连接 为了兼容老版本 需要指定 keep-alive
  • Content-Type

    • 本次数据的格式

    • Content-Type: application/x-www-form-urlencoded

      • 普通表单
    • Content-Type: Content-Type: multipart/form-data

      • 上传文件
    • Content-Type: application/json

      • json axios 默认 json
    • Content-Type: text/plain;charset=UTF-8

      • 文本类型
    • text/html;charset = utf-8

      • html 格式 编码 utf-8
  • Content-Encoding

    • 数据压缩的方法
    • gzip / deflate

\