Closed kieranbarlow closed 5 years ago
Is it possible to pass headers to the printURL() method?
No, it's no possible. Because if you see we are setting the URL directly to the iframe. So I think your query token solution is suitable for.
But afterwards (after page load) you can do it for future requests if you want via the callback.
Remember that the callback receives those params above. So , for example you can leverage the iframe param and append all headers you want.
Solution from your side
Use a custom XHR request for fetch the page using your headers and then pass just the content to the iframe via print()
method.
Is it possible to pass headers to the printURL() method? I'm testing printd in a single page application and the endpoint is locked behind JWT authentication.
I could attach the token to the url.
I feel a more elegant approach would be better.