samedi 4 novembre 2017

Ember.js client app consumes Spring Rest API -- missmatch in Accept headers thereof

So the Ember client app has

Accept:application/vnd.api+json

whereas Spring Rest has this header

Content-Type:application/hal+json;charset=UTF-8

Thus I'm getting this error when trying to consume the API:

Error: Ember Data Request GET http://localhost:8080/api/users/1 returned a 406 Payload (Empty Content-Type)

I would prefer to keep Spring's one, especially if this one is more suitable to be consumed by my yet-to-be-developed Android app.

So far I found out that customizing Ember Data serializer could be a soulution but haven't found any viable solution.

Does Spring Boot provide an easy way to at least set it up to produce application/vnd.api+json?




Aucun commentaire:

Enregistrer un commentaire