我是 Axios 请求,因为使用会导致 414 错误。这是对象:postgetrows= { 0 : { "name":"Thor", "status":"active", "email":"somuchlightning@kaboom.io", }, 1 : { "name":"Mesa", "status":"active", "email":"big-mesa@tundra.com", }, 2 : { "name":"Jesper", "status":"stdby", "email":"jes@slap.net, },}这只是对象格式的一个示例。在实际的一个中有400多个元素,因此而不是。我在正确构建表单数据时遇到了麻烦。以下是我所拥有的:postgetlet data = new FormData();Object.keys(rows).forEach(key => data.append(key, rows[key])); // <--- this doesn't dodata.set('target', target); // <---- this comes through just fineaxios({ method: 'post', url: 'byGrabthorsHammer.php', data: data, headers: {'Content-Type': 'multipart/form-data'}}).then(function(response) { if (response.error) { console.log('failed to send list to target'); console.log(response); } else { console.log('response: '); console.log(response); } });通过的只是var_dump($_POST);'。这不是我想要的。我怎么能正确地重写这个,以便我得到数据到另一边(如GET...)。[Object][Object]' when i
添加回答
举报
0/150
提交
取消