在功能测试中无法将内容类型设置为Json

时间:2011-08-27 22:54:34

标签: json playframework functional-testing

我有以下代码来发出json请求,但它失败了:

Response response = POST("/b/profile/","application/json",body);

我也试过这个:

Response response = POST("/b/profile/","application/x-www-form-urlencoded",body);

但是响应再次具有内容类型text/html。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

尝试

Response response = POST("/b/profile/","text/javascript",body);

有关详细信息,请参阅here