Json-server is not saving all data when performing POST

Asked

Viewed 52 times

0

I got the following database high:

{
  "clientes": [
    {
      "id": 1,
      "nome": "xxx",
      "cidade": "Orlândia"
    },
    {
      "id": 2,
      "nome": "yyy",
      "cidade": "Franca"
    },
    {
      "id": 3,
      "nome": "zzz",
      "cidade": "Franca"
    }
  ]
}

When I give the get in the url in Postman the data is returned successfully, but when I give a post in the url: http://localhost:5000/clientes

inserir a descrição da imagem aqui

I send the following data and returns only the id, when I give the get again is added only the id.

I’m forgetting something?

  • How’s the content-type of Header?

  • I got it now, I’ll add the answer

1 answer

0


Solved when I switched from "form-data" to "x-www-form-urlencoded"

Browser other questions tagged

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