RSS Feed Subscribe to RSS Feed

 

Versioning APIs

I have blogged in the past about microservices, and the advantages that architectural style can bring. These small, focussed and, most importantly, autonomous services commonly expose their functionality via a REST interface.

Inevitably there will come a time when you need to change that interface. Yes, in an ideal world, you will come up with a perfect API first time round and it will never need to change, but requirements change or new users come on board, and we must adapt. Read on to find some approaches to dealing with changing interfaces without breaking clients.

(more…)

Tags: , , , , , , , , ,

415 ‘Unsupported Media Type’ error when submitting JSON from a JSP

I’ve been experimenting with submitting JSON data from a JSP to a Spring MVC Controller, using the Spring MVC Ajax example as my guide.

But after setting everything up, I continually ran into this error:

NetworkError: 415 Unsupported Media Type
The server refused this request because the request entity is in a format not supported by the requested resource for the requested method().

After much googling, I found a plethora of solutions, none of which worked for me. In the end, I found it was because I had omitted this line from my JSP:

Hope that helps someone else…

Tags: , , ,