Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

78
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!