Headers

In configuration you can add global headers, it's will be used in all resource

requests.

createConfig({
  Main: {
    ...
    headers: {
      'X-Custom-Header': 'CustomValue'
    },
    ...
  }
})

Also, without configuration requests contains theese headers by default:

Authorization: Bearer <token>
X-CSRFToken: <csrf-token>
Content-Type: "application/json"

What if I need header only for one request?

You can add it in request optons:

...
httpGet("Main", "endpoint", { headers: { "my-custom-header": "bruh" } }
...

Last updated