public async Task <ProductDto> Get(int id) { var client = _proxyHttpClient.Get(ProxyHttpClient.CatalogAPI); var response = await client.GetAsync($"products/v1/{id}"); response.EnsureSuccessStatusCode(); return(await response.Content.ReadAsAsync <ProductDto>()); }
public async Task <DataCollection <StoreDto> > Paged(int page) { var client = _proxyHttpClient.Get(ProxyHttpClient.CatalogAPI); var response = await client.GetAsync($"stores/v1?page={page}&pageSize=5"); response.EnsureSuccessStatusCode(); return(await response.Content.ReadAsAsync <DataCollection <StoreDto> >()); }
public async Task <AccessTokenAuthModel> Authenticate(LoginAuthModel model) { var client = _proxyHttpClient.Get(ProxyHttpClient.AuthAPI); var response = await client.PostAsJsonAsync("auth/login", model); response.EnsureSuccessStatusCode(); return(await response.Content.ReadAsAsync <AccessTokenAuthModel>()); }