0
여기 내 문제입니다.이 경우 요청한 개체가 발견되지 않으면 제안 된대로 NULL을 반환하는 WCF REST 코드 조각이 있습니다. 여기에 내 코드REST WCF 서비스가 404 대신 HEAD에서 오류 500을 보내고 있습니다.
if (imageStream == null) {
WebOperationContext.Current.OutgoingResponse.SetStatusAsNotFound("Image not available for the requested size.");
return null;
}
GET에서 예상대로이 404 오류를 보내고이지만, HEAD 500 내부 서버 오류
어떤 아이디어를 보내는?
WebFaultException에 대해 경우 (같이 ImageStream == NULL) { WebOperationContext입니다 .Current.OutgoingResponse.SetStatusAsNotFound ("요청한 크기로 이미지를 사용할 수 없습니다."); WebOperationContext.Current.OutgoingResponse.ContentLength = 0; WebOperationContext.Current.OutgoingResponse.ContentType = "image/jpeg"; 새 WebFaultException을 throw합니다 (HttpStatusCode.NotFound); } –