Created
June 6, 2022 16:01
-
-
Save Rickedb/3d566519da8ba3240b922d4e99129fda to your computer and use it in GitHub Desktop.
Basic soap call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = new HttpClient(); | |
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "<token>"); | |
var xml = "<xml>"; | |
var soapAction = "<soap-action>"; | |
var httpContent = new StringContent(xml, Encoding.UTF8, "text/xml"); | |
var request = new HttpRequestMessage(new HttpMethod("POST"), url) | |
{ | |
Content = httpContent | |
}; | |
request.Headers.Add("SOAPAction", soapAction); | |
var response = await client.SendAsync(httpContent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment