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

79
Visualizações
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 à 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