Hi Ali,
You can create HttpClient to send the request to your web API with token as authorization request header.
Code below is for your reference :
var client = new HttpClient();
client.BaseAddress = new Uri("http://example.com");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YourToken");
var result = await client.GetStringAsync("/api/ipam/prefixes/");
For saving token in client, it’s up to you to decide where save the token, in memory cache, in database, or in cookie.
Hope this could be helpful.
Best Regards,
Timon
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.