Home Javascript 不借助任何工具使用浏览器的api发送ajax请求
Post
Cancel

Javascript 不借助任何工具使用浏览器的api发送ajax请求

refer to: POE

fetch('https://ixxxt/info.do',
    {
      method: 'POST',
      body: my_binary,
      headers
    }
  )
  .then(response => {
    if (!response.ok) {
      throw new Error('Network response was not ok');
    }
    return response.arrayBuffer();
  })
  .then(buffer => {
    // 在这里处理二进制数据
    console.log('Binary Data:', buffer);
  })
  .catch(error => {
    console.error('Error:', error);
  });

This post is licensed under CC BY 4.0 by the author.