The PUT request is not sending the whole object

0

This is the put I am giving, (below will have the Json that is coming from the body):

put(endpoint: string, body: any) {
  return new Promise((resolve, reject) => {
    return this.http.put(this.url + '/' + endpoint, body)
      .subscribe(res => {
          resolve(res.json())
        },
        (error: any) => {
          this.loader.hide();
          this.MessageErroRequest(error);
        });
  });
}

The method is sending like this:

{
  "id": 1,
  "nome": "LESPAUL",
  "validade": 1525568400000,
  "dataGerada": 1525914000000,
  "status": true,
  "itens": [
    []
  ]
}

And the object that I'm sending is like this, it just does not go, when I put the BODY it removes the Array "items":

[{
  "id": 1,
  "nome": "LESPAUL",
  "validade": 1525568400000,
  "dataGerada": 1525914000000,
  "status": true,
  "itens": [{
    "cliente": {
      "id": 1,
      "login": "gabriel",
      "senha": "123",
      "tipoDeLogin": 1,
      "telefone": "99916-2410",
      "endereco": "Zetete Tororo 25",
      "nome": "Gabriel Sereno",
      "cpf": "12312312312"
    }
  }]
}]
    
asked by anonymous 12.06.2018 / 03:00

0 answers