M
M
mr jeery2018-10-24 21:06:53
JavaScript
mr jeery, 2018-10-24 21:06:53

How to pass JWT header to Swagger request?

Good evening, please help
I have a function that uses Swagger for queries.

export async function SwaggerClient() {
  return Swagger({ url: window.App.apiUrl })
}

And the request itself
SwaggerClient({
      url: '/api/profiles',
      method: 'GET',
    })
      .then(response => {
        console.log('getProfile', response)
      })
      .catch(error => {
        console.log('getProfileError', error)
      })

To get profile data, you need to pass jwt in the header, visually it looks like this, but which header to put in the request code?
5bd0b47d0ce63985082695.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question