Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/280.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
C# Angular 9 http.delete返回不支持的媒体415_C#_Angular - Fatal编程技术网

C# Angular 9 http.delete返回不支持的媒体415

C# Angular 9 http.delete返回不支持的媒体415,c#,angular,C#,Angular,我在谷歌上读过一些答案,它们都指向了以前使用angular版本发布的老方法。我怎样才能让这个为angular 9工作?当前正在从我的typescript文件发送此文件 错误 Get/Post/Put使用完全相同的格式没有问题从fiddler/logs中查看发布的是什么类型的内容?您可以发布控制器端点签名中的代码吗?您使用的是from body还是query?415通常表示错误的方法(GET、POST等…),如果我将其替换为.GET、.POST或.put请求,则完全是.delete导致了此问题 t

我在谷歌上读过一些答案,它们都指向了以前使用angular版本发布的老方法。我怎样才能让这个为angular 9工作?当前正在从我的typescript文件发送此文件

错误


Get/Post/Put使用完全相同的格式没有问题

从fiddler/logs中查看发布的是什么类型的内容?您可以发布控制器端点签名中的代码吗?您使用的是from body还是query?415通常表示错误的方法(GET、POST等…),如果我将其替换为.GET、.POST或.put请求,则完全是.delete导致了此问题
this.deletingUser.UserId = deleteUser.userId;
this.deletingUser.ShopId = deleteUser.shopId;
this.deletingUser.AccessType = 0;

this.http.delete(environment.apiUrl + 'UserAccess/', this.deletingUser).subscribe(response => {
      console.log(response);
    }, error => {
      console.log(error);
    });
status: 415 title: "Unsupported Media Type"
traceId: "|5c70708d-40084eb40ba86edc."
type: "https://tools.ietf.org/html/rfc7231#section-6.5.13"