Exemplo n.º 1
0
        public async Task <Response <string> > GetAsync(string uriExtension)
        {
            try
            {
                var response = await GetResponseAsync(uriExtension);

                return(await ResponseFactory.GenerateResponseSimple(response));
            }
            catch (Exception)
            {
                SetRediscoverServiceUri();
                throw;
            }
        }
Exemplo n.º 2
0
        public async Task <ResponseSimple> DeleteAsync(string uriExtension)
        {
            try
            {
                var client = await GetHttpClient();

                var response = await client.DeleteAsync(_absoluteUri + uriExtension);

                return(await ResponseFactory.GenerateResponseSimple(response));
            }
            catch (Exception)
            {
                SetRediscoverServiceUri();
                throw;
            }
        }
Exemplo n.º 3
0
        public async Task <ResponseSimple> PutAsync <T>(string uriExtension, T message)
        {
            try
            {
                var content = SerializeAsJson(message);
                var client  = await GetHttpClient();

                var response = await client.PutAsync(_absoluteUri + uriExtension, content);

                return(await ResponseFactory.GenerateResponseSimple(response));
            }
            catch (Exception)
            {
                SetRediscoverServiceUri();
                throw;
            }
        }