728x90
반응형
필요에 따라
요청 헤더의 Host와 RequestUri를 변경할 수 있는데
Host와 RequestUri 모두 아래와 같은 형태로 변경 가능하다.
HttpAuthenticationContext context;
var req = context.Request;
req.Headers.Host = new Uri("HostUri").Authority;
req.RequestUri = new Uri("RequestUri");
추가적으로
RequsetUri에서 Host를 제외한 경로를 갖고 오고싶다면
var absolutPath = req.RequestUri.AbsolutePath;
위와 같이 하면 가져올 수 있다.
728x90
반응형
'프로그래밍' 카테고리의 다른 글
Azure AD PowerShell을 이용해 토큰 만료 시간 정책 설정 하기 (0) | 2021.07.09 |
---|---|
c# String.Substring 마지막 문자열 자르기 (0) | 2021.07.06 |
[c#] Web Api System.Web.Http AuthorizeAttribute 이용시 Bearer Token CustomAuthorize 구현 (0) | 2021.07.02 |
'application/octet-stream' is not supported for this resource 해결 방법 (0) | 2021.06.30 |
[C#] ASP.NET Web Api Controller 작업시 json으로 반환 하기 (0) | 2021.06.24 |
댓글