How to remove header in requests

after i setup my reruests header like this:

Framework7.request.setup({
  headers: {
    'Authorization': 'sometokenvalue'
  }
})

how can remove 'Authorization': 'sometokenvalue' if i dont want it anymore?

Framework7.request.setup({
  headers: {
  }
})

?

i did that before. not changing anything.

It is not possible to remove it once you set it globally. You may try to set it to something invalid like:

Framework7.request.setup({
  headers: {
    'Authorization': ''
  },
})

i tried that too along with null. the issue is my backend will reject any request if the header value im sending is not valid. so i must remove it or no request will be completed.

Then you have 2 options

  • wait until new update where this should be fixed and header set to undefined won’t be added
  • don’t use global config

:slight_smile:

ok
for now i check if the header is invalid and reload the window in cordova and that seems to remove the header values. :slightly_smiling_face:

1 Like