christianmalek / vuex-rest-api

A utility to simplify the use of REST APIs with Vuex
http://vuex-rest-api.org
MIT License
382 stars 48 forks source link

Add option to pass request specific headers #112

Closed m-demydiuk closed 9 months ago

m-demydiuk commented 9 months ago

@christianmalek We need this change in our project, so we can provide custom headers for every specific request that is done.

I know I can use headers() function, but in our case(s) there are 2 concearns:

  1. We also use queryParams - and custom headers are added to the query string
  2. We have some logic based on system settings, user preferences, and so on. Putting this logic in the headers() function is not possible, because introduces a lot of tight coupling.
m-demydiuk commented 9 months ago

@christianmalek could you please provide some update and this pr? Is there anything you don't like and want to change? This is a very small change, but also it is a very useful change, I think. And we are waiting for this. Now we use headers function, but the problem is that headers are attached to the url query string.

christianmalek commented 9 months ago

LGTM. I've merged your PR, contributed you in the changelog and updated the NPM package. Thanks for your contrib!

m-demydiuk commented 9 months ago

LGTM. I've merged your PR, contributed you in the changelog and updated the NPM package. Thanks for your contrib!

Thanks a lot!