【问题标题】:Add content of a url to respondText in Ktor将 url 的内容添加到 Ktor 中的 respondText
【发布时间】:2018-11-14 12:10:26
【问题描述】:


我有一个url,我想使用 Ktor 框架将其显示为我的网页内容。

fun Application.module() {
    install(DefaultHeaders)
    install(CallLogging)
    install(Routing) {

        get("/") {
            call.respondText(/*Content of that url in the output ?*/, ContentType.Text.Any)
        }
    }
}

提前致谢。

【问题讨论】:

    标签: kotlin ktor


    【解决方案1】:

    这看起来像是一种代理。您可以在此处查看反向代理示例:https://github.com/ktorio/ktor-samples/tree/master/other/reverse-proxy

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-26
      • 1970-01-01
      • 2020-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多