public string PostXMLString(String url, object request) { HttpClient httpClient = new HttpClient(); var xml = XmlBuilder.SerializeToXMLString(request); HttpResponseMessage httpResponseMessage = httpClient.PostAsync(url, xml).Result; var a = httpResponseMessage.Content.ReadAsStringAsync().Result; return(a); }
public string PostXMLString(String url, object request) { ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; HttpClient httpClient = new HttpClient(); var xml = XmlBuilder.SerializeToXMLString(request); HttpResponseMessage httpResponseMessage = httpClient.PostAsync(url, xml).Result; var a = httpResponseMessage.Content.ReadAsStringAsync().Result; return(a); }