Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs directusCMS中使用axios的修补程序请求失败_Reactjs_Http_Axios_Directus - Fatal编程技术网

Reactjs directusCMS中使用axios的修补程序请求失败

Reactjs directusCMS中使用axios的修补程序请求失败,reactjs,http,axios,directus,Reactjs,Http,Axios,Directus,我正在尝试发送补丁请求以更新或更改directus CMS中的图像。。(更改它只需要此链接中已解决的项和文件的id。) ) 下面是它的简化代码,因为我试图实现的是制作一个包含名称、电子邮件、日期等的项目,然后向这些文件发送文件或图像 然后我需要修补我刚刚制作的物品,这是我现在还不能做的 仅供参考。。我用的是盖茨比 我已经在《邮递员》上试过了,效果不错。。也许我的代码有问题。谢谢 axios.patch( `${process.env.GATSBY_DIRECTUS_API_URL}/gemacl

我正在尝试发送补丁请求以更新或更改directus CMS中的图像。。(更改它只需要此链接中已解决的项和文件的id。)

)

下面是它的简化代码,因为我试图实现的是制作一个包含名称、电子邮件、日期等的项目,然后向这些文件发送文件或图像

然后我需要修补我刚刚制作的物品,这是我现在还不能做的

仅供参考。。我用的是盖茨比

我已经在《邮递员》上试过了,效果不错。。也许我的代码有问题。谢谢

axios.patch( `${process.env.GATSBY_DIRECTUS_API_URL}/gemaclc/items/pendaftar/49?access_token=${process.env.GATSBY_DIRECTUS_TOKEN}`, {
    data: JSON.stringify( {
        kartu_keluarga: 1,
          
      
      }), 
  })

我删除了JSON.stringify,它可以正常工作

axios( `${process.env.GATSBY_DIRECTUS_API_URL}/gemaclc/items/pendaftar/50?access_token=${process.env.GATSBY_DIRECTUS_TOKEN}`, 
{
  method:"patch",
  data :{
        kartu_keluarga: 1,
        nama: "zidsadanaaa"
          
      
      }, 
  }
  
  )