22.8. 응답 코드
Camel은 HTTP 응답 코드에 따라 처리합니다.
- 응답 코드는 범위 100.299이며 Camel은 성공 대응과 관련이 있습니다.
-
응답 코드는 범위 300..399에 있으며 Camel은 리디렉션 응답과 관련이 있으며 정보가 있는
HttpOperationFailedException
을 throw합니다. -
응답 코드는 400 이상이며 Camel은 외부 서버 오류로 간주하고 정보를 사용하여
HttpOperationFailedException
을 throw합니다.
throwExceptionOnFailure 옵션 throwExceptionOnFailure , 실패 응답 코드에 대해 HttpOperationFailedException이 throw 되지 않도록 false
로 설정할 수 있습니다.The option, throwExceptionOnFailure
, can be set to false to prevent the HttpOperationFailedException
from being thrown for failed response codes. 이를 통해 원격 서버에서 모든 응답을 가져올 수 있습니다.
아래에 이를 설명하는 샘플이 있습니다.