try { Data cus = new Data { Searchterm = searchterm }; response = await httpclient.PostAsJsonAsync(request.RequestUri,cus); If(response.IsSuccessStatusCode) { var customerresult = await response.Content.ReadFromJsonAsync<customerresponse>(); customers= customerresult.BaseObjects.ToList(); } } catch (HttpRequestException ex) { navigationmanager.NavigateTo("\page"); }
else
if
If(response.IsSuccessStatusCode) { var customerresult = await response.Content.ReadFromJsonAsync<customerresponse>(); customers= customerresult.BaseObjects.ToList(); }
else { // handle non-success return codes here var status = response.StatusCode; // display its value }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)