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

234
Visualizações
getting [Object object] instead of String in node.js request

I am having a slight issue here, I am working on a project (already built), but there's a slight issue in it, that is whenever I type a name or string that is not in the database and try to log it (after hitting send request button) using console.log(req.body.connection) or console.log(JSON.stringify(req.body.connection[0]), it prints this

  connection:
   '[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]'

instead of "xyz@gmail.com" or "someRandomString" (the string that I entered and hit the send request button).

You can see in this image that I am typing a random string sfsfsf and in payload it gives me that same [Object object] in connection property, it should be sfsfsf string in place of that. enter image description here Can someone tell me why is this? And how can I resolve this problem? I would really appreciate the help.

Edit: If seeing the code explains better, then here it is. Notice that I am getting connection : "[object Object]" as string. enter image description here

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