R
R
Roman2022-02-13 19:01:25
JavaScript
Roman, 2022-02-13 19:01:25

How to read the token in the header when opening the page?

There is an application that opens a page of the site through a webview, and before opening it writes a token in the header. Code below

var request = webView21.CoreWebView2.Environment.CreateWebResourceRequest(url, "GET", Stream.Null, "");
        request.Headers.SetHeader("bearer", token);
        webView21.CoreWebView2.NavigateWithWebResourceRequest(request);
        webView21.CoreWebView2.Navigate(url);

The front of the site is written in blazor. It is necessary to read the recorded token when opening the page.

As I understand it, there is no such functionality on blazor and you need to write it in js. Tell me how to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shamanov, 2022-02-13
@SilenceOfWinter

response.headers.get('bearer')

R
Roman, 2022-02-14
@yarosroman

via JS only. as an example
https://stackoverflow.com/questions/59469742/get-u...
https://docs.microsoft.com/en-us/aspnet/core/blazo...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question