I am stuck in a problem, where my webservice (written in Spring boot) takes 5-6 minutes for a http response. I send a http post request from angular but chrome waits for only 2 minutes gives me a null response since there was no response from server. But server will give a response after 5 minutes. So how can I implement this scenario, since I think my http connection closes after 2 minutes and I want to extend it till 5-6 minutes. FYI I have already used rxjs timeout function but it doesn't work, the default timeout of 2 mins always wins. Thank you
相关问题
- Angular RxJS mergeMap types
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- How to update placeholder text in ng2-smart-table?
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- angular脚手架在ie9+下兼容问题
- angular 前端项目 build 报错 "Cannot find module 'le
- Angular Material Stepper causes mat-formfield to v
- After upgrade to Angular 9 cannot find variable in
- is there any difference between import { Observabl
- Suppress “Circular dependency detected” suppress w
- How can you get current positional information abo
The issue is not with
chrome
You must be usingProxying support
in which dev-server makes usehttp-proxy-middleware package
and the proxy options provided in this package is from underlyinghttp-proxy library
. one among them isThe default value is ~120 seconds and a new request is made if the
backend
fails to respond within the stipulated time. overriding the default timeout with"timeout":360000
in the proxy config file will resolve the issue.you also need to enable Cross-Origin Requests for a RESTful Web Service using
@CrossOrigin
annotation in your controller link.The@CrossOrigin
is used to allow Cross-Origin Resource Sharing (CORS) so that our angular application running on a different server can consume these APIs from a browser.I assume your angular is running on
port
4200 with above configuration you can consume your API's.NOTE: The
proxy
configuration is intended to proxy calls when running the dev server viang serve
. After you runng build
you are responsible for the web server and its configurations