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