Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.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
如何在angular 5 delete方法中传递json对象_Angular - Fatal编程技术网

如何在angular 5 delete方法中传递json对象

如何在angular 5 delete方法中传递json对象,angular,Angular,使用此方法传递对象时出错您不能。您只能将URL传递给deletehttp方法。您可能希望尝试使用put或post(并相应地更改API)。您可以向我们显示什么错误对于http删除,请求没有正文。通常您在url中使用一些id。您的API文档说明了什么?将API方法更改为put,而不是delete,然后从客户端使用put,并传递对象。 deletekeystore(deletekeystore: Deletekeystore) { console.log("KeyStoreContext@@@

使用此方法传递对象时出错

您不能。您只能将URL传递给
delete
http方法。您可能希望尝试使用
put
post
(并相应地更改API)。

您可以向我们显示什么错误对于http删除,请求没有正文。通常您在url中使用一些id。您的API文档说明了什么?将API方法更改为
put
,而不是
delete
,然后从客户端使用
put
,并传递对象。
deletekeystore(deletekeystore: Deletekeystore) {
    console.log("KeyStoreContext@@@@@@@@@");
    return this.http.delete(this.baseUrl + '/deletekeystore', deletekeystore);
}