Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

110
Visualizações
$http POST array params sent incorrectly in payload : Angular JS

i am assigning an array to a key which need to be send in the payload of POST call in my angular js application. for example like below.

this.selectedCtlIds =[877, 982, 091, 112];

function saveFormSettings() {
 let data = this.settings; // have various key from the GET call
 data.statusIdToBeChanged = this.selectedCtlIds;
 console.log(data.statusIdToBeChanged, 'test '); // works fine

 Service.updateSettings(data).then(function (resp) {
  //POST CALL HERE
}

}


function updateSettings(param) {
    return $http({
        method: 'POST',
        url: url + '/setting',
        params: param
    })
}

expected payload by api is like statusIdToBeChanged: [877, 982, 091, 112]

instead it is passed like below when i checked in network payload

statusIdToBeChanged[]: 284
statusIdToBeChanged[]: 982
statusIdToBeChanged[]: 091
statusIdToBeChanged[]: 112

due to which the api is failing. i am not sure why it is like this in payload.

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda