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

80
Vistas
How do I append a header object to another header object

I want to add two new header properties to all my api requests, instead of adding it one by one, is there a way I could append the new header properties, to the existing headers, that way I get to define the new header once and call it everywhere I need it. Something like:

So instead of this:

headers: {
                'Content-Type': 'application/json',
                'float-app': 'app Name',
                'float-version': 'version',
            },

I could do something like this:

newHeader: {
        'float-app': 'app Name',
        'float-version': 'version name',
      }

headers: {
       'Content-Type': 'application/json',
       newHeader,
     },

Currently with the above approach, I'm getting this:

headers: {
           'Content-Type': 'application/json',
              {
                'float-app': 'app Name',
                'float-version': 'version name',
              },
         },

Is there something I'm missing please?

about 4 years ago · Santiago Trujillo
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