public async Task <IActionResult> Test([FromBody] ScrapeRequest scrapeRequest) { HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, scrapeRequest.Url); HttpClient httpClient = httpClientFactory.CreateClient(); HttpResponseMessage response = await httpClient.SendAsync(request); Scrape scrape = new Scrape(); scrape.HttpResponseMessage = response; int tries = 0; int seed = (int)DateTime.Now.Ticks; do { scrape.Id = Scrape.GenerateId(seed); tries++; }while (scrapes[scrape.Id] != null && tries < 20); scrapes.Add(scrape); return(Ok(scrape)); }