Answers for "supertest headers"

1

supertest set header for all requests

request(app)
  .set('Authorization', 'abc123') // DOES NOT WORK
  .post('/api')

request(app)
  .post('/api')
  .set('Authorization', 'abc123') // Works.
Posted by: Guest on January-22-2021

Browse Popular Code Answers by Language