2013-01-02 58 views
3

當我嘗試將地圖傳遞到後,我得到這個錯誤:的WebService(WS)POST在播放2.0 - 斯卡拉

Cannot write an instance of scala.collection.immutable.Map[java.lang.String,java.lang.String] to HTTP response. Try to define a Writeable[scala.collection.immutable.Map[java.lang.String,java.lang.String]]

這是帖子例如:

WS.url("http://mysql/endpoint") 
    .post(Map("email" -> "[email protected]")).map { response => 
    Logger.logger.debug("response: " + response.body) 
    } 

什麼正在發生?

回答

11

這裏是提示:你必須發送Map[String, Seq[String]]

WS.url("http://mysql/endpoint") 
    .post(Map("email" -> Seq("[email protected]"))).map { response => 
    Logger.logger.debug("response: " + response.body) 
    }