无法理解 reactjs 和 postman 中的 axios 补丁方法

问题描述

当我点击提交按钮时,执行以下代码

const response = await axios.put('http://demo0725191.mockable.io/patch_data',{ new_name: 'My new cool name!' });

我的邮递员看起来像这样:

enter image description here

如您所见,它的主体包含 { new_name: 'My new cool name!' }

现在,当我将方法put 更改为 patch 时:

const response = await axios.patch('http://demo0725191.mockable.io/patch_data',{ new_name: 'My new cool name!' });

然后,在 react.js 中执行上面的代码,邮递员看起来像这样:

enter image description here

enter image description here

如您所见,它没有 body ,但我发送了 { new_name: 'My new cool name!' } 作为 axios 中的 body。它应该包含 body 。不应该吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)