2
Could someone explain to me how to receive a List as a parameter in a Restful Java webservices ? I’ve searched a lot of places, but I still can’t figure it out. Thank you in advance ! The code below is an example and as I did in my actual code. In the request, I send a JSON with the products, the web-services returns 200 OK, but print "[]".
@path("/incluirProdutos")
@consumes(MediaType.APPLICATION_JSON)
@produces(MediaType.APPLICATION_JSON)
public String incluirProdutos(List<Produto> produtos){
return produtos.toString();
}
Good morning, Just like there in the code. I don’t know if this is possible. It would be ?
– Thiago00.
I intend to make the server and the client, so I’ll do everything in Java. However, I could talk a little more about what would be the applicability of the serialization of the object, in this context ?
– Thiago00.