public static async Task<string> SendData3(string URL, string jsonParam)
{
string result = "";
string URLToken = $"https://192.168.111.111:1111/BSAPI/V1/ProductionData/getToken?machineNO=sponge01&key=28853ACB-FA6A-47A5-9B22-9578880290BD";
string Token = await testGetToken(URLToken, "");
var handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = delegate { return true; };
using (var client = new HttpClient(handler))
{
var request = new HttpRequestMessage(HttpMethod.Post, URL);
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", Token);
request.Content = new StringContent(jsonParam, Encoding.UTF8, "application/json");
var response &#
C#Httpclient post请求发送requestBody json参数
最新推荐文章于 2025-04-10 12:10:50 发布