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

270
Visualizações
Sending data with fetch. How to include variable in body

I use the API of a online service to send the email of a client that just made an order from my eshop. I do this using fetch in javascript. What i want you to help me with is how to iclude the variable, that has as value the email of the client, to the body of my request. The variable is newClientMail and the body of the request is body: '{"email": }'.
body: '{"email": newClientMail}' if i write it that way i get an internal server error status 500.


let newClientMail = clientEmail.replace('/', '');

fetch('https://useapi.useinbox.com/inbox/v1/contactlists/61b212ba8813690001cd5228/add', {
        method: 'POST', 
        headers: {'Content-Type': 'application/json',
                   'Authorization': 'Bearer ' + authToken},
        body: '{"email": }'                                                            
        })
        })
        .then(function (response) {
        return response.json(); 
         })
        .then(function (data) {
         console.log(data);
        })

about 4 years ago · Juan Pablo Isaza
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