Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to set header on every request? #268

Open
mariadb-zdraganov opened this issue Mar 11, 2020 · 0 comments
Open

Is it possible to set header on every request? #268

mariadb-zdraganov opened this issue Mar 11, 2020 · 0 comments

Comments

@mariadb-zdraganov
Copy link

I saw that when using chai.request.agent(app) there is a possibility to reuse the cookie across all the requests.
If my API needs header authentication, is it possible to append a header on every request similar to the cookie workflow?

Something like this:

const agent = chai.request.agent(app)
agent.beforeSend(request => request.set('X-AUTH', 'authentication token'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant