All works well, but when using a RadzenUpload component, I don't know how to tell it to use that custom HttpClient (apparently it uses a different one, because security information is never attached).
Is there any way to tell it to use a different HttpClient?
Thank you.
AB
RadzenUpload doesn't use any HttpClient - it performs the upload client-side via the XMLHttpRequest JavaScript object. You can try passing the required authentication via custom HTTP headers. Check our online demo for reference:
Interesting. I could make it work, accessing the IAccessTokenProvider, and retrieving the JWT to add.
Thank you for the amazing fast support (and it's a free library! ), and for the quality of the library, although in this little case, I'm a little bit puzzled by the design choice: I gave a look at the source code, and I cannot say I totally agree on using JS Interop for such a simple task.
Anyway, thank you!
AB
The upload doesn't happen via interop. It happens entirely client-side to avoid uploading huge files via SignalR (to use HttpClient in Blazor Server scenarios).
Yes, sorry, I didn't explain myself well, you are perfectly right, of course.
Nonetheless, you could use the .NET HttpClient: surely you had your good reason to not go that way...
No, I understand your concerns. However to support Blazor server we have to take the file contents from the browser to the server first (in order to use HttpClient) which is not always the best idea, especially for large files. For Blazor WASM we could indeed use HttpClient (which too uses XMLHttpRequest under the hood).
I was reading this thread because I'm trying to send multiple files.
Could you give an example to use in BLazor webassembly, I am not sure how to configure the url and the token in the header for the radzem upload component