I've been using Postman
to test some RESTful services and came across a strange error in the body of the response from a service - "Unexpected 'N'"
. I knew for a fact that the service was not returning this error so something else must have been going haywire.
This is what I was seeing in Postman...
However when I switched to raw output, I could see it was displaying 'Not Found'. That was an error string that the service could return. So what was going on here?
Well the service was annotated with this:
That meant that Postman was expecting a JSON object response and was getting a simple string instead!
So Postman was correctly saying that the service response was returning an unexpected value based on the application specification (via the @Produces annotation).
Hope you found this post useful...
...so please read on! I love writing articles that provide beneficial information,
tips and examples to my readers. All information on my blog is provided free of
charge and I encourage you to share it as you wish. There is a small favour I ask in return however -
engage in comments below, provide feedback, and if you see mistakes let me know.
If you want to show additional support and help me pay for web hosting and
domain name registration,
donations, no matter how small, are always welcome!
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...