ByteNote LogoByteNote

Navigation

  • Blog
  • 工具

    © 2025 ByteNote. All rights reserved.

    fetch 发送 post 请求

    Oct 26, 20219 min read
    (async () => {
      const rawResponse = await fetch('https://httpbin.org/post', {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({a: 1, b: 'Textual content'})
      });
      const content = await rawResponse.json();
    
      console.log(content);
    })();
    

    相关文章

    如何通过浏览器控制台刷新页面?

    JavaScript代码`location.reload()`用于刷新当前页面,只需在浏览器控制台输入并回车即可执行。

    Flutter 查询当前运行的平台的方法

    使用dart.io.Platform类可以获取并输出当前运行的平台的名称,如Android、iOS、macOS、Windows或Linux。

    docker run 的 --restart 参数unless-stopped 和 always 的区别?

    --restart参数的unless-stopped和always策略分别允许Docker容器在意外停止后自动重启或在任何情况下始终重启,以确保容器持续运行。

    Go 运行时遵循“深度优先”

    Go 运行时通常采用深度优先原则执行函数调用,以保证完整性和资源利用效率,但也可能根据情况优化调用顺序以提升性能。

    OneKey Card:新一代虚拟卡,让支付更简单便捷

    Yishi 公司推出的 OneKey Card 是一款无需下载App、支持多种币种和分等级费率的虚拟卡,目前处于公测阶段,通过邀请码可注册使用。