【发布时间】:2015-10-25 19:42:55
【问题描述】:
我正在尝试使用喷雾执行一个简单的 json 帖子。但似乎我可以获得一个可以是 Marshall 的 json 对象的 http 实体。
这是我的错误:
[错误] ...../IdeaProjects/PoolpartyConnector/src/main/scala/org/iadb/poolpartyconnector/thesaurusoperation/ThesaurusCacheService.scala:172: 找不到类型的证据参数的隐式值 spray.httpx.marshalling.Marshaller[spray.json.JsValue]
[错误] 验证请求 = Post(s"$thesaurusapiEndpoint/$coreProjectId/suggestFreeConcept?", 建议JsonBody)
及其附带的代码:
override def createSuggestedFreeConcept(suggestedPrefLabel: String, lang: String, scheme: String, b: Boolean): String = {
import system.dispatcher
import spray.json._
val pipeline = addCredentials(BasicHttpCredentials("superadmin", "poolparty")) ~> sendReceive
val label = LanguageLiteral(suggestedPrefLabel, lang)
val suggestion = SuggestFreeConcept(List(label), b, Some(List(scheme)), None, None,None, None)
val suggestionJsonBody = suggestion.toJson
val request = Post(s"$thesaurusapiEndpoint/$coreProjectId/suggestFreeConcept?", suggestionJsonBody)
val res = pipeline(request)
getSuggestedFromFutureHttpResponse(res) match {
case None => ""
case Some(e) => e
}
}
请问,有没有人知道隐式编组器发生了什么。我虽然喷雾 Json 会附带隐式编组器。
【问题讨论】:
标签: scala spray spray-json