js 下载

1.form

const formSendData = (sendData, url) => {
          let input = document.createElement(‘input‘);
          input.type = ‘text‘;
          input.name = ‘json‘;
          input.value = JSON.stringify(sendData);
          let form = document.createElement(‘form‘);
          document.body.appendChild(form);
          form.appendChild(input);
          form.method = ‘POST‘;
          form.action = url;
          form.submit();
          document.body.removeChild(form)
        }

 

js 下载

上一篇:ajax自己封装


下一篇:httprunner 3.X学习