开发者

Spring Rest 415 Unsupported Types Error

We are in the process of changing all our web services from GET to POST. After the change to RequestMethod.Post I am getting 415 Unsupported Operations. The URL's to the service are like this. /WebService. So no extension. The way the services are being done these services are only working with JSON. I am unsure how to configure the content negotiating resolver without breaking the mediaTypes. Is that the problem or is it something else?

The other thing I attempted to do was change the @RequestBody to just accept a String. In that case at least it hit the web service. But when I change it to an ob开发者_如何学运维ject or something of that nature, it's the 415 Unsupported Error.

Thanks.


When you are trying to send up objects to your Web Method are the objects serilizable? If not I believe they must be, this is why sending up a string is working fine. In some cases some classes may contain List or other types that are not initially serilizable but anything can be essentially if you write the code for it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜