我有一个 MEAN 应用程序。Angular CLI:7.1.4 节点:10.1.0 操作系统:win32 x64 Angular:7.1.4
最近来自 HttpClientModule 的 http 请求卡住了,没有发布到节点服务器: Img of chrome dev tools xhr pending request
nodejs 服务器(在本地和生产中运行(azure web 应用程序)并不表示它曾经收到过请求。这种情况不一致。有时它完成有时它只是挂起。这是从 Angular 到服务器:
角度服务
import { Injectable } from '@angular/core';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { environment } from '../../environments/environment';
const Headers: any = { withCredentials: true, responseType: 'json', headers: { 'Content-Type': 'application/json' } };
@Injectable({
providedIn: 'root',
})
export class …Run Code Online (Sandbox Code Playgroud)