add api key

This commit is contained in:
kittapath 2024-08-15 22:16:46 +07:00
parent 7015f4ff2a
commit 6f60af960f
4 changed files with 6 additions and 4 deletions

View file

@ -216,6 +216,7 @@ namespace BMA.EHR.Recruit.Service.Services
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync();