add api key

This commit is contained in:
kittapath 2024-08-15 22:16:34 +07:00
parent 2ee9df8db1
commit 0b753795b8
3 changed files with 6 additions and 2 deletions

View file

@ -2109,6 +2109,7 @@ namespace BMA.EHR.Recurit.Exam.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();
@ -2321,6 +2322,7 @@ namespace BMA.EHR.Recurit.Exam.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();