본문 바로가기
728x90

c#3

기본 연결이 닫혔습니다. 보내기에서 예기치 않은 오류가 발생했습니다. var httpResponse = (HttpWebResponse)httpRequest.GetResponse(); 호출 시 -> 기본 연결이 닫혔습니다. 보내기에서 예기치 않은 오류가 발생했습니다. // .NET 4.0 이하에서 TLS 1.2 활성화 ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; // TLS 1.2의 정수 값 // .NET 4.5 이상에서 TLS 1.2 활성화 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 2023. 11. 7.
<string xmlns="http://tempuri.org/"> </string> 없애기 [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public void function() { HttpContext.Current.Response.ContentType = "application/json"; // error on line 1 at column 1: document is empty string result = new JavaScriptSerializer().Serialize(new { result = list }); HttpContext.Current.Response.Write(result); } 2022. 6. 15.
ASP.NET Core Restfull API 및 postman 호출 with visual studio 2022 A. 웹 프로젝트 만들기 파일 메뉴에서 새로 만들기>프로젝트를 선택합니다. 검색 상자에 Web API를 입력합니다. ASP.NET Core Web API 템플릿을 선택하고 다음을 선택합니다. 새 프로젝트 대화 상자 구성에서 TodoApi 프로젝트 이름을 지정하고 다음을 선택합니다. 추가 정보 대화 상자에서 다음을 수행합니다. 프레임워크가 .Net 6.0(장기 지원)인지 확인합니다. 컨트롤러 사용(최소 API를 사용하려면 선택 취소) 확인란을 선택합니다. 만들기를 선택합니다. B. launchUrl 업데이트 Properties\launchSettings.json에서 launchUrl을 "swagger"에서 "api/todoitems"로 업데이트합니다. "launchUrl": "api/todoitems", .. 2022. 6. 12.
728x90