Skip to content

Commit

Permalink
KTOR-6501 Add feedback link to KDocs (#4531)
Browse files Browse the repository at this point in the history
  • Loading branch information
e5l authored Jan 31, 2025
1 parent 255ce5e commit 747fef9
Show file tree
Hide file tree
Showing 748 changed files with 7,931 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import io.ktor.client.engine.*
* ```
*
* You can learn more about client engines from [Engines](https://ktor.io/docs/http-client-engines.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.Android)
*/
public data object Android : HttpClientEngineFactory<AndroidEngineConfig> {
override fun create(block: AndroidEngineConfig.() -> Unit): HttpClientEngine =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ private val METHODS_WITHOUT_BODY = listOf(HttpMethod.Get, HttpMethod.Head)

/**
* An Android client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidClientEngine)
*/
@OptIn(InternalAPI::class)
public class AndroidClientEngine(override val config: AndroidEngineConfig) : HttpClientEngineBase("ktor-android") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,39 @@ import javax.net.ssl.*

/**
* A configuration for the [Android] client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig)
*/
public class AndroidEngineConfig : HttpClientEngineConfig() {
/**
* Specifies a time period (in milliseconds) in which a client should establish a connection with a server.
*
* Set this value to `0` to use an infinite timeout.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig.connectTimeout)
*/
public var connectTimeout: Int = 100_000

/**
* Specifies a maximum time (in milliseconds) of inactivity between two data packets when exchanging data with a server.
*
* Set this value to `0` to use an infinite timeout.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig.socketTimeout)
*/
public var socketTimeout: Int = 100_000

/**
* Allows you to configure [HTTPS](https://ktor.io/docs/client-ssl.html) settings for this engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig.sslManager)
*/
public var sslManager: (HttpsURLConnection) -> Unit = {}

/**
* Allows you to set engine-specific request configuration.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.android.AndroidEngineConfig.requestConfig)
*/
public var requestConfig: HttpURLConnection.() -> Unit = {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import io.ktor.client.engine.*
* ```
*
* You can learn more about client engines from [Engines](https://ktor.io/docs/http-client-engines.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.Apache)
*/
public data object Apache : HttpClientEngineFactory<ApacheEngineConfig> {
override fun create(block: ApacheEngineConfig.() -> Unit): HttpClientEngine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,74 @@ import javax.net.ssl.SSLContext

/**
* A configuration for the [Apache] client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig)
*/
public class ApacheEngineConfig : HttpClientEngineConfig() {
/**
* Specifies whether to follow redirects automatically.
* Disabled by default.
*
* _Note: By default, the Apache client allows `50` redirects._
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.followRedirects)
*/
public var followRedirects: Boolean = false

/**
* Specifies a maximum time (in milliseconds) of inactivity between two data packets when exchanging data with a server.
*
* Set this value to `0` to use an infinite timeout.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.socketTimeout)
*/
public var socketTimeout: Int = 10_000

/**
* Specifies a time period (in milliseconds) in which a client should establish a connection with a server.
*
* A `0` value represents an infinite timeout, while `-1` represents a system's default value.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.connectTimeout)
*/
public var connectTimeout: Int = 10_000

/**
* Specifies a time period (in milliseconds) in which a client should start a request.
*
* A `0` value represents an infinite timeout, while `-1` represents a system's default value.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.connectionRequestTimeout)
*/
public var connectionRequestTimeout: Int = 20_000

/**
* Allows you to configure [SSL](https://ktor.io/docs/client-ssl.html) settings for this engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.sslContext)
*/
public var sslContext: SSLContext? = null

/**
* Specifies a custom processor for [RequestConfig.Builder].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.customRequest)
*/
public var customRequest: (RequestConfig.Builder.() -> RequestConfig.Builder) = { this }
private set

/**
* Specifies a custom processor for [HttpAsyncClientBuilder].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.customClient)
*/
public var customClient: (HttpAsyncClientBuilder.() -> HttpAsyncClientBuilder) = { this }
private set

/**
* Customizes a [RequestConfig.Builder] in the specified [block].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.customizeRequest)
*/
public fun customizeRequest(block: RequestConfig.Builder.() -> Unit) {
val current = customRequest
Expand All @@ -69,6 +87,8 @@ public class ApacheEngineConfig : HttpClientEngineConfig() {

/**
* Customizes a [HttpAsyncClientBuilder] in the specified [block].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache.ApacheEngineConfig.customizeClient)
*/
public fun customizeClient(block: HttpAsyncClientBuilder.() -> Unit) {
val current = customClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import io.ktor.client.engine.*
* ```
*
* You can learn more about client engines from [Engines](https://ktor.io/docs/http-client-engines.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5)
*/
public data object Apache5 : HttpClientEngineFactory<Apache5EngineConfig> {
override fun create(block: Apache5EngineConfig.() -> Unit): HttpClientEngine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,51 @@ import javax.net.ssl.SSLContext

/**
* A configuration for the [Apache5] client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig)
*/
public class Apache5EngineConfig : HttpClientEngineConfig() {
/**
* Specifies whether to follow redirects automatically.
* Disabled by default.
*
* _Note: By default, the Apache client allows `50` redirects._
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.followRedirects)
*/
public var followRedirects: Boolean = false

/**
* Specifies a maximum time (in milliseconds) of inactivity between two data packets when exchanging data with a server.
*
* Set this value to `0` to use an infinite timeout.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.socketTimeout)
*/
public var socketTimeout: Int = 10_000

/**
* Specifies a time period (in milliseconds) in which a client should establish a connection with a server.
*
* A `0` value represents an infinite timeout, while `-1` represents a system's default value.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.connectTimeout)
*/
public var connectTimeout: Long = 10_000

/**
* Specifies a time period (in milliseconds) in which a client should start a request.
*
* A `0` value represents an infinite timeout, while `-1` represents a system's default value.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.connectionRequestTimeout)
*/
public var connectionRequestTimeout: Long = 20_000

/**
* Allows you to configure [SSL](https://ktor.io/docs/client-ssl.html) settings for this engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.sslContext)
*/
public var sslContext: SSLContext? = null

Expand All @@ -59,6 +71,9 @@ public class Apache5EngineConfig : HttpClientEngineConfig() {
* Default value is [HostnameVerificationPolicy.BOTH] which provides maximum security
* by performing verification at both stages.
*
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.sslHostnameVerificationPolicy)
*
* @see HostnameVerificationPolicy
*/
public var sslHostnameVerificationPolicy: HostnameVerificationPolicy = HostnameVerificationPolicy.BOTH
Expand All @@ -69,6 +84,8 @@ public class Apache5EngineConfig : HttpClientEngineConfig() {

/**
* Customizes a [RequestConfig.Builder] in the specified [block].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.customizeRequest)
*/
public fun customizeRequest(block: RequestConfig.Builder.() -> Unit) {
val current = customRequest
Expand All @@ -77,6 +94,8 @@ public class Apache5EngineConfig : HttpClientEngineConfig() {

/**
* Customizes a [HttpAsyncClientBuilder] in the specified [block].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.apache5.Apache5EngineConfig.customizeClient)
*/
public fun customizeClient(block: HttpAsyncClientBuilder.() -> Unit) {
val current = customClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import io.ktor.client.engine.*
* ```
*
* You can learn more about client engines from [Engines](https://ktor.io/docs/http-client-engines.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.CIO)
*/
public data object CIO : HttpClientEngineFactory<CIOEngineConfig> {
override fun create(block: CIOEngineConfig.() -> Unit): HttpClientEngine =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,28 @@ import io.ktor.network.tls.*

/**
* A configuration for the [CIO] client engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.CIOEngineConfig)
*/
public class CIOEngineConfig : HttpClientEngineConfig() {
/**
* Provides access to [Endpoint] settings.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.CIOEngineConfig.endpoint)
*/
public val endpoint: EndpointConfig = EndpointConfig()

/**
* Allows you to configure [HTTPS](https://ktor.io/docs/client-ssl.html) settings for this engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.CIOEngineConfig.https)
*/
public val https: TLSConfigBuilder = TLSConfigBuilder()

/**
* Specifies the maximum number of connections used to make [requests](https://ktor.io/docs/request.html).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.CIOEngineConfig.maxConnectionsCount)
*/
public var maxConnectionsCount: Int = 1000

Expand All @@ -33,59 +41,82 @@ public class CIOEngineConfig : HttpClientEngineConfig() {
* from sending a request to receiving a response.
*
* To disable this timeout, set its value to `0`.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.CIOEngineConfig.requestTimeout)
*/
public var requestTimeout: Long = 15000

/**
* Allows you to configure [HTTPS](https://ktor.io/docs/client-ssl.html) settings for this engine.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.CIOEngineConfig.https)
*/
public fun https(block: TLSConfigBuilder.() -> Unit): TLSConfigBuilder = https.apply(block)
}

/**
* Provides access to [Endpoint] settings.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.endpoint)
*/
public fun CIOEngineConfig.endpoint(block: EndpointConfig.() -> Unit): EndpointConfig = endpoint.apply(block)

/**
* Contains [Endpoint] settings.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.EndpointConfig)
*/
public class EndpointConfig {
/**
* Specifies the maximum number of connections for each host.
*
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.EndpointConfig.maxConnectionsPerRoute)
*
* @see [CIOEngineConfig.maxConnectionsCount]
*/
public var maxConnectionsPerRoute: Int = 100

/**
* Specifies a connection keep-alive time (in milliseconds).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.EndpointConfig.keepAliveTime)
*/
public var keepAliveTime: Long = 5000

/**
* Specifies a maximum number of requests to be sent over a single connection without waiting for the corresponding responses (HTTP pipelining).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.EndpointConfig.pipelineMaxSize)
*/
public var pipelineMaxSize: Int = 20

/**
* Specifies a time period (in milliseconds) in which a client should establish a connection with a server.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.EndpointConfig.connectTimeout)
*/
public var connectTimeout: Long = 5000

/**
* Specifies a maximum time (in milliseconds) of inactivity between two data packets when exchanging data with a server.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.EndpointConfig.socketTimeout)
*/
public var socketTimeout: Long = HttpTimeoutConfig.INFINITE_TIMEOUT_MS

/**
* Specifies a maximum number of connection attempts.
* Note: this property affects only connection retries, but not request retries.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.EndpointConfig.connectAttempts)
*/
public var connectAttempts: Int = 1

/**
* Allows a socket to close an output channel immediately on writing completion (half-closed TCP connection).
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.cio.EndpointConfig.allowHalfClose)
*/
public var allowHalfClose: Boolean = false
@Deprecated("Half closed TCP connection is not supported by all servers, use it at your own risk.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import kotlinx.coroutines.*

/**
* Creates a raw [ClientWebSocketSession]: no ping-pong and other service messages are used.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.plugins.websocket.cio.webSocketRawSession)
*/
public suspend fun HttpClient.webSocketRawSession(
method: HttpMethod = HttpMethod.Get,
Expand Down Expand Up @@ -53,6 +55,8 @@ public suspend fun HttpClient.webSocketRawSession(

/**
* Creates a raw [ClientWebSocketSession]: no ping-pong and other service messages are used.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.plugins.websocket.cio.webSocketRaw)
*/
public suspend fun HttpClient.webSocketRaw(
method: HttpMethod = HttpMethod.Get,
Expand Down Expand Up @@ -80,6 +84,8 @@ public suspend fun HttpClient.webSocketRaw(

/**
* Creates a raw [ClientWebSocketSession]: no ping-pong and other service messages are used.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.plugins.websocket.cio.wsRaw)
*/
public suspend fun HttpClient.wsRaw(
method: HttpMethod = HttpMethod.Get,
Expand All @@ -94,6 +100,8 @@ public suspend fun HttpClient.wsRaw(

/**
* Create secure raw [ClientWebSocketSession]: no ping-pong and other service messages are used.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.plugins.websocket.cio.wssRaw)
*/
public suspend fun HttpClient.wssRaw(
method: HttpMethod = HttpMethod.Get,
Expand Down
Loading

0 comments on commit 747fef9

Please sign in to comment.