/// <summary> /// 读取网关发回的数据 /// </summary> /// <returns></returns> public static GatewayData ReadNotifyData() { var gatewayData = new GatewayData(); if (IsGetRequest) { gatewayData.FromUrl(HttpUtil.QueryString); } else { if (IsXmlData) { var reader = new StreamReader(HttpUtil.Body); string xmlData = reader.ReadToEnd(); reader.Dispose(); gatewayData.FromXml(xmlData); } else { try { #if NETSTANDARD2_0 gatewayData.FromForm(HttpUtil.Form); #else gatewayData.FromNameValueCollection(HttpUtil.Form); #endif } catch { } } } return(gatewayData); }
/// <summary> /// 读取网关发回的数据 /// </summary> /// <returns></returns> public static GatewayData ReadNotifyData() { var gatewayData = new GatewayData(); if (IsGetRequest) { gatewayData.FromUrl(HttpUtil.QueryString); } else { if (IsXmlData) { var reader = new StreamReader(HttpUtil.Body); string xmlData = reader.ReadToEnd(); reader.Dispose(); gatewayData.FromXml(xmlData); } else { try { gatewayData.FromForm(HttpUtil.Form); } catch { } } } return(gatewayData); }