I'm using the Fetch API for the first time. Does it have something akin to jQuery's ajaxSetup() method, in order to set authorization headers for future requests? I can't find any evidence that it does.
I'm using the Fetch API for the first time. Does it have something akin to jQuery's ajaxSetup() method, in order to set authorization headers for future requests? I can't find any evidence that it does.
You can create authorisation headers using Request, saving to a variable allows it to be reusable. Note that according to the jQuery docs, setting default values using jQuery.ajaxSetup() is not recommended
Then use the fetch request as usual