openapistack / openapi-client-axios

JavaScript client library for consuming OpenAPI-enabled APIs with axios
https://openapistack.co
MIT License
558 stars 67 forks source link

Global headers #18

Closed timeconsumer closed 4 years ago

timeconsumer commented 4 years ago

Is there a way to initialize a client with global headers so that you don't have to pass the same one for each request?

anttiviljami commented 4 years ago

Sure! https://github.com/anttiviljami/openapi-client-axios/blob/master/DOCS.md#parameter-optsaxiosconfigdefaults

anttiviljami commented 4 years ago

Also, the client instance is just an axios instance, so you can directly modify client.defaults.headers

timeconsumer commented 4 years ago

Thanks!

paz commented 5 months ago

This is no longer present in the documentation. For those looking for it, see from the previous commit: https://github.com/openapistack/openapi-client-axios/blob/235fc7a578f11257c36c09ff27b0e90af68c5291/DOCS.md#authentication