I am currently working on a web application that relies on backend processing. To communicate between my Angular(v14)/Typescript front end and an ASP.NET backend, I am sending a post request.
Backend Code
[HttpPost]
public async Task<string> ProcessExcelFile(IFormFile fileData, IFormCollection data)
{
string guid = await processor.ProcessFile(fileData, data) //Not important for the question.
return guid;
}
Frontend Code
var guid: string = "";
this.http.post<string>('/api', formData).subscribe(result => {guid = result;});
After debugging, I have confirmed that the backend is being reached successfully and returning the correct data.
However, even though the backend processing may take a few seconds, the frontend "guid" remains empty after the post request is made. What could be causing this issue?
Is the delay in backend processing causing the problem? How can I address this issue?