首页 > 解决方案 > 错误:未捕获(承诺):HttpErrorResponse: {"headers":{"normalizedNames":[],"statusText":"Bad Request"} 仅在 Safari 浏览器上

问题描述

在 Safari 浏览器上调用 PUT 方法时,Angular 应用程序出现以下错误,但在 Chrome 浏览器上也可以正常工作。

 returnData = await this.http.put(applicationUrl, formattedData).toPromise(); 

[Error] Failed to load resource: the server responded with a status of 503 (Service Unavailable) 
       (pixel, line 0)
[Error] Failed to load resource: the server responded with a status of 503 (Service Unavailable) 
   (setuid, line 0)
 [Error] Failed to load resource: the server responded with a status of 400 (Bad Request) (11929, line 0)
 [Error] Error: Uncaught (in promise): HttpErrorResponse: 
 {"headers":{"normalizedNames":[],"lazyUpdate":null},"status":400,"statusText":"Bad Request","url":"http://localhost:4200/api/application/11929","ok":false,"name":"HttpErrorResponse","message":"Http failure 

标签: angularpromiseangular6

解决方案


推荐阅读