【问题标题】:error - Spray-http: not found: type HttpBody错误 - Spray-http: not found: type HttpBody
【发布时间】:2017-03-27 13:00:29
【问题描述】:

我一直在使用喷雾 - 1.1-M7,但现在我改为 1.3.3。 1.1-M7 中有 HttpBody,但在 1.3.3 版本中不存在。那么我必须在我的代码中做些什么。

我的代码如下所示:我需要做什么才能获得:

implicit def json4sUnmarshaller[T: Manifest] = {
    Unmarshaller[T](`application/json`) {
      case x: HttpBody ⇒
        read[T](cleanupString(x.asString))
    }
  }

【问题讨论】:

  • 我没有这样写我的解组器,所以我不确定它会起作用,但你正在寻找的类型是HttpEntity
  • 我建议长期切换到 akka-http。
  • 谢谢@FredericA。看起来工作正常。
  • @Sun 不客气,为了清楚起见,我已将其添加为建议的答案

标签: scala akka spray spray-json


【解决方案1】:

你要找的类型是HttpEntity

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-05-09
    • 1970-01-01
    • 1970-01-01
    • 2017-12-31
    • 2015-06-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多