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

How do I add header to the data-table? #45

Closed
kahwooi opened this issue Nov 1, 2017 · 3 comments
Closed

How do I add header to the data-table? #45

kahwooi opened this issue Nov 1, 2017 · 3 comments

Comments

@kahwooi
Copy link

kahwooi commented Nov 1, 2017

How can I add Authorization to the data-table request header?

SOLVED

In main.js, I did this:

axios.defaults.baseURL = 'http://localhost'
axios.defaults.headers.common = {
  'Authorization': 'Bearer',
  'Accept': 'application/json'
}
@kahwooi kahwooi closed this as completed Nov 1, 2017
@mjalindahl
Copy link

@kahwooi I'm having the same issue.

I tried adding your solution to my main.js and it doesn't seem to be doing anything. Could you please elaborate?

Thanks!

@smartapant
Copy link
Contributor

smartapant commented Dec 21, 2017

@mjalindahl check out https://github.com/axios/axios and read it's docs, it's quite easy to use. (you need to install axios via npm of course)

@mjalindahl
Copy link

@smartapant That doesn't help. I use axios every day, and am quite familiar with it.

Pasting the "solution" in main.js does not solve the issue. The apiUrl call still sends the request without headers to the API.

Could you explain where the actual apiUrl is being run? Is there other stuff that needs to be changed?

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

3 participants