Beispiel #1
0
        public void CuandoSeInvocaElEndpointConLosParametros(string endpoint, string parametros)
        {
            this.Valores["endpoint-codigo"] = null;
            this.Valores["endpoint-json"]   = null;

            var app = Conf.Create();

            using (var client = app.CreateClient())
            {
                var resp = client.GetAsync($"{endpoint}/{string.Join("/", new string[] { parametros })}".TrimEnd('/')).Result;
                this.Valores["endpoint-codigo"] = (int)resp.StatusCode;
                this.Valores["endpoint-json"]   = resp.Content.ReadAsStringAsync().Result;
            }
        }