using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mesnac.Action.ChemicalWeighing.InterfaceDocking { public class HttpResponse { public string PostResponse(TankIsDischargedSyncEntity taskIsDisChargedSyncEntity) { HttpItem item = new HttpItem() { URL = "", //URL 必需项 Method = "post",//URL 可选项 默认为Get ContentType = "application/json",//返回类型 可选项有默认值 PostDataType = PostDataType.String, PostEncoding = Encoding.UTF8, Postdata = taskIsDisChargedSyncEntity.JsonTo(), ResultType = ResultType.String }; try { HttpResult httpResult = new HttpHelper().GetHtml(item); return httpResult.Html; } catch (Exception ex) { string message = $" url:{item.URL} {Environment.NewLine} Data:{item.Postdata} {Environment.NewLine} 异常信息:{ex.Message}"; return ex.Message; } } } }