This commit is contained in:
thuannd88
2024-09-06 10:15:39 +07:00
parent 7e927dfcc9
commit 8fb4e9ae92
8 changed files with 55 additions and 29 deletions
+4 -5
View File
@@ -19,7 +19,6 @@ namespace SafeBagDE70.API
{
public static class APIModels
{
public static string URL = "http://203.171.20.94:9103/Safebag/";
public static async void SendHealthCheck_old(string? ID=null)
{
try
@@ -30,7 +29,7 @@ namespace SafeBagDE70.API
// Pass the handler to httpclient(from you are calling api)
HttpClient httpClient = new HttpClient(clientHandler);
using HttpResponseMessage response = await httpClient.GetAsync(URL + "HealthCheck?Id=" + ID);
using HttpResponseMessage response = await httpClient.GetAsync(AppData.BaseURL + "HealthCheck?Id=" + ID);
if (response.EnsureSuccessStatusCode().StatusCode == HttpStatusCode.OK)
{
@@ -57,7 +56,7 @@ namespace SafeBagDE70.API
string strJsonObj = JsonConvert.SerializeObject(deviceStatus);
var content = new StringContent(strJsonObj, Encoding.UTF8, "application/json");
using HttpResponseMessage response = await httpClient.PostAsync(URL + "HealthCheck_v2", content);
using HttpResponseMessage response = await httpClient.PostAsync(AppData.BaseURL + "HealthCheck_v2", content);
if (response.EnsureSuccessStatusCode().StatusCode == HttpStatusCode.OK)
{
@@ -86,7 +85,7 @@ namespace SafeBagDE70.API
string strJsonObj = JsonConvert.SerializeObject(data2Send);
var content = new StringContent(strJsonObj, Encoding.UTF8, "application/json");
using HttpResponseMessage response = await httpClient.PostAsync(URL + "UpdateCountingData", content);
using HttpResponseMessage response = await httpClient.PostAsync(AppData.BaseURL + "UpdateCountingData", content);
if (response.EnsureSuccessStatusCode().StatusCode == HttpStatusCode.OK)
{
@@ -105,7 +104,7 @@ namespace SafeBagDE70.API
{
try
{
var url = URL + "GetAeonMallCustomers?tenantId="+tenantId;
var url = AppData.BaseURL + "GetAeonMallCustomers?tenantId="+tenantId;
HttpClientHandler clientHandler = new HttpClientHandler();
clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; };