How to globally "inject" or intercept headers in HTTP?

Is there some sort of HTTP middleware or some other way to add custom header to all requests except specific few ? I’m have backend api with username/password auth. After user is authenticated server returns access token which souls be used with all other requests.