This commit is contained in:
parent
b478b9eded
commit
b4cc522fef
32 changed files with 413 additions and 412 deletions
|
|
@ -60,7 +60,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", apiKey);
|
||||
client.DefaultRequestHeaders.Add("api-key", apiKey);
|
||||
var _res = await client.GetAsync(apiPath);
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
|
|
@ -91,7 +91,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", apiKey);
|
||||
client.DefaultRequestHeaders.Add("api-key", apiKey);
|
||||
var _res = await client.SendAsync(request);
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
|
|
@ -113,7 +113,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var json = JsonConvert.SerializeObject(body);
|
||||
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
//stringContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||
|
|
@ -121,7 +121,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", apiKey);
|
||||
client.DefaultRequestHeaders.Add("api-key", apiKey);
|
||||
var _res = await client.PostAsync(apiPath, stringContent);
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
|
|
@ -149,7 +149,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", apiKey);
|
||||
client.DefaultRequestHeaders.Add("api-key", apiKey);
|
||||
var _res = await client.PostAsync(apiPath, stringContent);
|
||||
return _res.IsSuccessStatusCode;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue