繁體中文
Appearance
預設情況下,Ktor 用戶端會重導向至 Location 標頭中提供的 URL。如有需要,您可以停用重導向。
Location
HttpRedirect 僅需要 ktor-client-core 構件,不需要任何特定的相依性。
HttpRedirect
若要停用重導向,請在 用戶端配置區塊 中將 followRedirects 屬性設定為 false:
followRedirects
false
val client = HttpClient(CIO) { followRedirects = false }