【发布时间】:2014-08-20 19:09:36
【问题描述】:
当我尝试获取类似的亚马逊身份数据时
val pipeline: HttpRequest => Future[IdentityData] = sendReceive ~> unmarshal[IdentityData]
pipeline(Get("http://169.254.169.254/latest/dynamic/instance-identity/document"))
使用适当的案例类和格式化程序,我收到以下异常
UnsupportedContentType(预期为“应用程序/json”)
因为亚马逊将他们的响应标记为 text/plain 内容类型。他们也不关心 Accept 标头参数。有没有一种简单的方法可以告诉 spray-json 在解组时忽略这一点?
【问题讨论】:
标签: scala playframework-2.0 spray spray-json spray-client