.NET is not happy with DELETE requests that use body content. With the API I'm integrating with, the request looked like it was being sent but the response always timed out. This occurred both with WebClient and HttpClient. The API developers see the request on their end and respond with 200 but HttpClient doesn't get the response and timesout. Their API def works because I've hit it with postman and other request tools.
I tried adding various request/response headers. Using both HttpClient and WebRequest directly. I would expect any response from the API.
DeleteWithPostAsync(string url, string json){ HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Delete, url) { Content = new StringContent(json, Encoding.UTF8, "application/json"), }; var result = await client.SendAsync(request).ConfigureAwait(false); var response = await result.Content.ReadAsStringAsync().ConfigureAwait(false); return response;}