[ASP.NET] HttpContext

Ceing·2025년 3월 22일
0

ASP.NET

목록 보기
11/13
post-thumbnail

개요

  • 요청과 응답을 전부 매핑해줌
  • 자바는 HttpServletRequest, HttpServletResponse로 분리되어있지만, ASP.NET은 하나로 처리하네 ㅇㅇ

HTTP 요청 메시지 파싱

HttpContext.Current.Request.ContentType
HttpContext.Current.Session[SESSION_KEY]

HTTP 응답 메시지 파싱

HttpContext.Current.Response.ContentType = "application/json";
HttpContext.Current.Response.Write(JsonConvert.SerializeObject(someObject));
HttpContext.Current.Response.End();
profile
이유에 대해 끊임없이 생각하고 고민하는 개발자

0개의 댓글