<stacklayout padding="5"> <listview x:name="MainListBox"> <listview.itemtemplate> <datatemplate> <viewcell> <stacklayout>
public MainPage() { InitializeComponent(); _Load(); } private async void _Load() { var httpclient = new HttpClient(); var response = await httpclient.GetStringAsync("https://localhost:22348/api/customer"); var login = JsonConvert.DeserializeObject<list<customer>>(response); MainListBox.ItemsSource = login; }
System.Net.WebException Message=failed to connect to localhost/127.0.0.1 (port 22348) after 86400000ms: isConnected failed: ECONNREFUSED (Connection refused)
System.Net.Http.HttpRequestException HResult=0x80072EFD Message=An error occurred while sending the request. Source=System.Net.Http StackTrace: at System.Net.Http.HttpClientHandler.<sendasync>d__111.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<finishsendasyncunbuffered>d__59.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<getstringasynccore>d__27.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at App5_temp2.MainPage.<login>d__1.MoveNext() in C:\Users\HRS7_PC\source\repos\App5_temp2\App5_temp2\App5_temp2\MainPage.xaml.cs:line 28 Inner Exception 1: COMException: The text associated with this error code could not be found. A connection with the server could not be established
localhost
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)