angular - Angular HTTP POST 响应在暂存中给出 404 Not Found Error 但在本地工作
问题描述
我正在开发与 REST 服务交互的 Angular UI 门户。我向现有的 REST 服务添加了更多端点。Swagger 和 Postman 对新的端点服务进行了 200 响应测试。此外,当我从本地的角度 UI 中点击服务时,我得到 200 响应。但是在 PCF 中的暂存服务器上部署时收到“404 Not Found”。同一服务中的其他端点返回成功。来自 Chrome 开发工具的错误响应...
error: {timestamp: "2020-08-13T19:36:44.354+0000", status: 404, error: "Not Found", message: "No message available", path: "/updtPOShipStatus"}
headers: e {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}
message: "Http failure response for https://ipaddress: 404 Not Found"
name: "HttpErrorResponse"
ok: false
status: 404
statusText: "Not Found"
url: "https://ipaddress/updtPOShipStatus"
httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Access-Control-Allow-Headers': 'Content-Type'
})
};
public updatePOflagStatus(poShipStatus: PurchaseOrderFlagStatus) : Observable<any>{
const poShipStatusRequestBody = {
poShipStatus : poShipStatus
};
return this.httpClient.post(this.updateShipStatusUrl, poShipStatusRequestBody, this.httpOptions);
}
我也无法在本地复制问题。请帮忙。
解决方案
推荐阅读
- c - C 中的 ## 运算符未按预期粘贴
- abap - 如何生成两个内部表的笛卡尔积?
- javascript - 如何获取单个数组中差异最大的元素?
- apache-spark - 即使在增加 spark.driver.memory 之后,PySpark 也会超出 Java 堆空间
- html - 我可以从 md 文件生成相互引用的 html 页面吗
- swift - SwiftUI:可以从任何视图触发的全局叠加层
- c# - 如何在 ajax 错误回调中为 errorThrown 参数设置自定义消息?
- python-3.x - 如何使用需要密码的证书使用 Web 服务肥皂?
- django - 接受多个值的端点,包括查询字符串
- javascript - 使用 keydown 处理程序控制焦点时,焦点轮廓在 Chrome 中不可见