Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

276
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda