2017-03-09 241 views
1

我在寫一個custome Health Indicator來檢查與另一個應用程序的連接。然而,爲了檢查這一點,我需要/ health端點的請求URL中的一些請求參數(例如,我想要的URL是「/ health?countryCode = IN」) 有沒有辦法實現這一點? 謝謝。有沒有辦法將請求參數傳遞給/ health端點?

回答

0

剛剛拿到請求注入,如:

public class CustomHealthIndicator{ 

@Autowire 
HttpServletRequest request; 
.... 
} 
+0

感謝@stefan ..它的工作。 – Mahendra

+0

只是提到錯字,它是 org.springframework.beans.factory.annotation.Autowired –

相關問題