เพิ่ม Header

This commit is contained in:
Bright 2024-08-15 16:01:23 +07:00
parent c9e2c91ab4
commit 6a9e069920
21 changed files with 154 additions and 2 deletions

View file

@ -89,6 +89,7 @@ namespace BMA.EHR.Placement.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();
@ -151,6 +152,7 @@ namespace BMA.EHR.Placement.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();