コード例 #1
0
        public async Task <IActionResult> GetActivo()
        {
            HttpClient client   = new HttpClient();
            var        response = await client.GetAsync($"{UrlExtractor.ExtractBaseUrl(Request.GetDisplayUrl())}/api/reportecaso");

            if (response.StatusCode == HttpStatusCode.OK)
            {
                return(Ok("API REST Activa."));
            }
            return(Ok($"Hay un problema con el servicio. ${response.StatusCode}"));
        }
コード例 #2
0
 public void ExtractBaseUrlOk(string baseUrlExpected, string url)
 {
     Assert.Equal(baseUrlExpected, UrlExtractor.ExtractBaseUrl(url));
 }