Receive a json as Java Servlet parameter

Asked

Viewed 119 times

0

I’m developing a API using java Servlet, would like to know how do I receive a JSON in the body of the request as parameter and save to a database?

Example:

{
    "nome": "José da Silva",
    "email": "[email protected]",
    "telefone": "(21) 99999-99099",
    "ativo": true,
    "empresa": {
      "nome": "Empresa Teste 1",
      "endereco": "Avenida das Américas",
      "site": "www.exemplo.com.br",
      "email": "[email protected]"
    }
  }
  • You can post what you have done so far regarding the sending and receiving of the request?

  • I haven’t done anything yet, I looked for some examples but I haven’t found any examples.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.