Repository: ktorio/ktor
File: ktor-client/ktor-client-core/common/src/io/ktor/client/HttpClientConfig.kt (Kotlin)

Code before:
     * val client = HttpClient(CIO) { // HttpClientConfig<CIOEngineConfig>
     *     engine { // CIOEngineConfig.() -> Unit
     *         proxy = ProxyBuilder.http("proxy.example.com", 8080)
     *     }
     * ```
     *
     * You can learn more from [Engines](https://ktor.io/docs/http-client-engines.html).
     */
    public fun engine(block: T.() -> Unit) {
        val oldConfig = engineConfig
        engineConfig = {
            oldConfig()
            block()
        }
    }

    /**
     * Specifies whether the client redirects to URLs provided in the `Location` header.
     * You can disable redirections by setting this property to `false`.
     *
     * For the advanced redirection configuration, use [HttpRedirect] plugin.
     */
    public var followRedirects: Boolean = true

    /**
     * Enable body transformations for many common types like [String], [ByteArray], [ByteReadChannel], etc.
     * These transformations are applied to the request and response bodies.
     *
     * The transformers will be used when the response body is received with a type:
     * ```kotlin
     * val client = HttpClient()
     * val bytes = client.get("https://ktor.io")
     *                   .body<ByteArray>()
     * ```
     *
     * The flag is enabled by default.
     * You might want to disable it if you want to write your own transformers or handle body manually.
     *
     * Check [defaultTransformers] documentation for more details.
     */
    public var useDefaultTransformers: Boolean = true

    /**
     * Terminates [HttpClient.receivePipeline] if the status code is not successful (>=300).
     * Learn more from [Response validation](https://ktor.io/docs/response-validation.html).
     *
     * Please check [HttpCallValidator] documentation to learn more details.
     */
    public var expectSuccess: Boolean = false

    /**

Review comment (suggestion):
```suggestion
     * Enables body transformations for many common types like [String], [ByteArray], [ByteReadChannel], etc.
```

Code after:
     * val client = HttpClient(CIO) { // HttpClientConfig<CIOEngineConfig>
     *     engine { // CIOEngineConfig.() -> Unit
     *         proxy = ProxyBuilder.http("proxy.example.com", 8080)
     *     }
     * ```
     *
     * You can learn more from [Engines](https://ktor.io/docs/http-client-engines.html).
     */
    public fun engine(block: T.() -> Unit) {
        val oldConfig = engineConfig
        engineConfig = {
            oldConfig()
            block()
        }
    }

    /**
     * Specifies whether the client redirects to URLs provided in the `Location` header.
     * You can disable redirections by setting this property to `false`.
     *
     * For an advanced redirection configuration, use the [HttpRedirect] plugin.
     */
    public var followRedirects: Boolean = true

    /**
     * Enables body transformations for many common types like [String], [ByteArray], [ByteReadChannel], etc.
     * These transformations are applied to the request and response bodies.
     *
     * The transformers will be used when the response body is received with a type:
     * ```kotlin
     * val client = HttpClient()
     * val bytes = client.get("https://ktor.io")
     *                   .body<ByteArray>()
     * ```
     *
     * This flag is enabled by default.
     * You might want to disable it if you want to write your own transformers or handle body manually.
     *
     * For more details, see the [defaultTransformers] documentation.
     */
    public var useDefaultTransformers: Boolean = true

    /**
     * Terminates [HttpClient.receivePipeline] if the status code is not successful (>=300).
     * Learn more from [Response validation](https://ktor.io/docs/response-validation.html).
     *
     * For more details, see the [HttpCallValidator] documentation.
     */
    public var expectSuccess: Boolean = false

    /**