Sorry for the late response, please try this code, create a new HttpRequestMessage object to set the content-type header and the xml content:
using (var httpClient = new HttpClient())
{
var request = new HttpRequestMessage(HttpMethod.Post, "http://domain.com");
request.Content = new StringContent("xml content here", Encoding.UTF8, "text/xml");
var response = await httpClient.SendAsync(request);
}
What you also need to do is to contact the service provider for the contract, check if you call the API correctly. It's better to negotiate with the service provider than guessing what kind of request you should send to the service.
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
Participant
893 Points
137 Posts
Re: Restfull API Post
Jun 25, 2015 11:06 PM|Caillen Zhong|LINK
Sorry for the late response, please try this code, create a new HttpRequestMessage object to set the content-type header and the xml content:
What you also need to do is to contact the service provider for the contract, check if you call the API correctly. It's better to negotiate with the service provider than guessing what kind of request you should send to the service.