js如何模拟multipart/form-data类型的请求


        var temp = document.createElement('form');

        temp.action = this.data.testURL;

        temp.method = 'post';

        temp.target = '_blank';

        temp.enctype = 'multipart/form-data';

        temp.style.display = 'none';

        var input = document.createElement('input');

        input.type = 'hidden';

        input.name = 'redirect:${23.5*2.35}'; // 重点来了

        temp.appendChild(input);

        document.body.appendChild(temp);

        temp.submit();

 

对,就只有代码,懂的人还是懂,不懂也不指望你能懂。有用请点赞,没用请评论,我就不信这个没用。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM