logo
  • 教程列表
  • SO官方文档
  • 取
    • 获取 JSON 数据
    • 设置请求标头
    • 发布数据
    • GlobalFetch
    • 发送 cookies
    • 使用 Fetch 从 Stack Overflow API 中显示问题
  1. StackOverflow 文档
  2. JavaScript 教程
  3. 取
  4. 设置请求标头

设置请求标头

Created: November-22, 2018

fetch('/example.json', {
    headers: new Headers({
        'Accept': 'text/plain',
        'X-Your-Custom-Header': 'example value'
    })
});
  • 发布数据
  • 获取 JSON 数据

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明