0
good evening to all,
I’m making a Restfull API for mere learning and ran into a simple problem, but I couldn’t find a solution on the internet.
I created this class to control games:
@Path("/games")
public class ManipulaGameRest {
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public List getListaGamesCadastrados(){
return ControlaGame.getListaGames();
}
when testing in Postman it worked perfectly, at first glance, however when trying to get WS to return JSON, passing "Content-Type" as "application/json" it still returned me an XML...
all I found on the net was to put only the "Mediatype.APPLICATION_JSON", as it did not work I was left without knowing what to do.
Can someone tell me how to solve this problem???
NOTE: no error occurred on console.
had already done it, had not solved
– user3061516