Example #1
0
        public static async Task PutAsync <T>(RestUrl api, T putObject) where T : class
        {
            using (var client = GetClient(api.Base))
            {
                var response = await client.PutAsync(api.Route, putObject, new JsonMediaTypeFormatter()).ConfigureAwait(false);

                response.EnsureSuccessStatusCode();
            }
        }
Example #2
0
        public static async Task DeleteAsync(RestUrl api)
        {
            using (var client = GetClient(api.Base))
            {
                var response = await client.DeleteAsync(api.Route).ConfigureAwait(false);

                response.EnsureSuccessStatusCode();
            }
        }
Example #3
0
        public static async Task <T> GetAllAsync <T>(RestUrl api) where T : class
        {
            using (var client = GetClient(api.Base))
            {
                var response = await client.GetAsync(api.Route).ConfigureAwait(false);

                response.EnsureSuccessStatusCode();

                return(await ProceedResponse <T>(response));
            }
        }