Files

52 lines
1.8 KiB
C#
Raw Permalink Normal View History

2025-11-20 15:56:30 +08:00
using System;
using System.Net;
using RestSharp;
namespace ConsoleApp7
{
public class PMSDataBase
{
public string hotel_code { get; set; } = "";
public string time { get; set; } = "";
public string sign { get; set; } = "";
public string hotel_id { get; set; } = "";
public string order_no { get; set; } = "";
public string room_no { get; set; } = "";
public string check_out_original { get; set; }
}
internal class Program
{
static void Main(string[] args)
{
//ssl 协议不兼容
var A = (SecurityProtocolType)48;
var B = (SecurityProtocolType)192;
var C = (SecurityProtocolType)768;
var D = (SecurityProtocolType)3072;
var E = (SecurityProtocolType)12288;
ServicePointManager.SecurityProtocol = A | B | C | D | E;
PMSDataBase data = new PMSDataBase()
{
hotel_code = "2079",
time = "1751426235",
sign = "a68b2596ce7c1ca970e82a00626c16e3",
hotel_id = "1101",
order_no = "",
room_no = "1102",
check_out_original = ""
};
//string BaseURL = "https://f.blv-oa.com:8099/rcu_pms_api/v1";
string BaseURL = "http://localhost:5027";
var client123 = new RestClient(BaseURL);
var request123 = new RestRequest("/api/values/hello", Method.POST);
//request123.AddHeader("Content-Type", "application/json");
request123.AddJsonBody(data);
var Response = client123.Execute(request123).Content;
string content12345 = Response;
Console.WriteLine(content12345);
Console.ReadKey();
}
}
}