我正在使用 Ktor HttpClient(CIO) 向 HTTP API 发出请求,该 API 的响应使用分块传输编码。
在调用使用分块传输编码的 API 时,是否可以使用 Ktor HttpClient(CIO) 来访问 HttpResponse 中的各个 Http 块?
无论我如何设置我的项目,我都会在启动时遇到以下异常:
“检测到不支持的挂起处理程序方法”。
我正在尝试使用https://docs.spring.io/spring/docs/5.2.0.BUILD-SNAPSHOT/spring-framework-reference/languages.html#coroutines 中描述的对协程的支持。
这是我的 gradle 设置(缩写)。我如何摆脱这个异常?
ext.kotlin_version = '1.3.70'
ext.kotlin_coroutines_core = '1.3.5'
ext.kotlin_coroutines_reactor = '1.3.5'
ext.spring_boot_version = '2.2.6.RELEASE'
ext.springfox_version='2.9.2'
ext.jackson_module_kotlin = '2.10.3'
...
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_core"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlin_coroutines_reactor"
implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_module_kotlin"
implementation "net.rakugakibox.spring.boot:logback-access-spring-boot-starter:2.7.1"
implementation "net.logstash.logback:logstash-logback-encoder:5.3"
implementation "org.springframework.boot:spring-boot-starter-actuator:$spring_boot_version"
implementation "io.micrometer:micrometer-registry-statsd:1.1.4"
implementation "io.springfox:springfox-swagger2:$springfox_version"
Run Code Online (Sandbox Code Playgroud)