I have a list of URLs that I use in one of my page to render html iframes from them (All URLs are my app actions and each one show a letter to the user). Now I want an action that inside that call each of these actions and merge the result into a single response and return that.
Something like this:
public IActionResult GetAllLettersAsPDF()
{
List<string> letterUrls = GetLettersList();
List<string> letterHtmls = new();
foreach(var letter in letters)
{
var letterHtml = // here's what I'm looking for to turn the url into string responce
letterHtmls.Add(letterHtml);
}
return MergeIntoSinglePDF(letterHtmls);
}
My question is whether there is a way in AspCore that I can call an action by having it's URL and get the string response from that.
My bottom-line solution is to use an HttpClient and call '127.0.0.1' from that for each action to gain the response but I'm wondering if there is more clean and efficient way to do that in ASP that does not involve networking and etc.