# Querying Elixir API from a UI

**URL:** <https://forum.elixirforum.com/t/querying-elixir-api-from-a-ui/23335>\
**Category:** Questions\
**Tags:** phoenix, beginner\
**Created:** [June 22, 2019, 11:11pm UTC](https://forum.elixirforum.com/t/querying-elixir-api-from-a-ui/23335 "2019-06-22T23:11:57Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kokolegorille](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kokolegorille/32/4784_2.png) [@kokolegorille](https://forum.elixirforum.com/u/kokolegorille)\
**Post date:** [June 23, 2019, 7:04am UTC](https://forum.elixirforum.com/t/querying-elixir-api-from-a-ui/23335/4 "2019-06-23T07:04:02Z")

</div>

Those are my headers with axios…

```elixir
const auth_headers = () => ({
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${AuthService.loadToken()}`,
  },
  credentials: 'same-origin',
});

```

My headers are a little bit different because I pass a token, but I can see I also added Accept keyword.

---

_[View the full topic](https://forum.elixirforum.com/t/querying-elixir-api-from-a-ui/23335)._
