fetch post传参
let formData = new FormData(); formData.append(‘grant_type‘, ‘client_credentials‘); formData.append(‘client_id‘, ‘game-client‘); formData.append(‘client_secret‘, ‘0a0e2b7c0f223ff235810cbdc70f1d97‘); formData.append(‘scope‘, ‘game_client‘); fetch(‘http://www.math80.com/token‘,{method: "POST",body:formData}) .then(function(response) { console.log(response) }) .catch(function(){ console.log(‘1232222‘) });
原文:http://www.cnblogs.com/fm060/p/7653589.html