i,尝试编写一个简单的CRUD应用程序,并出现错误:net :: ERR_CONNECTION_REFUSED 尝试调用服务器:
getPersons(): Observable<Array<Person>> {
return this.httpService.get<Array<Person>>(this.serverUrl + '/GetAllPersons',{headers: this.Headers});
Headers: any = { withCredentials: true, responseType: 'json', headers: { 'Content-Type': 'application/json' } };
服务器中的断点不会停止在
[HttpGet]
[Route("GetAllPersons")]
public IEnumerable<Person> GetAllPersons()
{
try
{
IEnumerable<Person> personArray = this.GetAllRecordsFromDB();
return personArray;
}
catch (Exception)
{
throw new Exception();
}
}
谢谢