add api key

This commit is contained in:
kittapath 2024-08-15 22:16:25 +07:00
parent 64e6de8e99
commit 7bfa5b00d6
3 changed files with 8 additions and 3 deletions

View file

@ -94,6 +94,7 @@ namespace BMA.EHR.Report.Service.Controllers
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();
@ -182,6 +183,7 @@ namespace BMA.EHR.Report.Service.Controllers
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();
@ -197,7 +199,7 @@ namespace BMA.EHR.Report.Service.Controllers
var tblInsignia = (Telerik.Reporting.Table)report0.Items["detailSection1"].Items["tblInsignia"];
tblInsignia.DataSource = org.result.Insignia;
var tblLeave= (Telerik.Reporting.Table)report0.Items["detailSection1"].Items["tblLeave"];
var tblLeave = (Telerik.Reporting.Table)report0.Items["detailSection1"].Items["tblLeave"];
tblLeave.DataSource = org.result.Leave;
report.DataSource = org.result.Profile;
@ -429,6 +431,7 @@ namespace BMA.EHR.Report.Service.Controllers
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();