Changed how the request is sent and added empty content var request = new HttpRequestMessage(HttpMethod.Delete, $"{baseUrl}{apiVersion}/contact_lists/{contactListId}"); request.Headers.Add("Authorization", $"Bearer {accessToken}"); request.Headers.Add("Accept", "application/json"); request.Content = new StringContent(string.Empty, Encoding.UTF8, "application/json"); and sent request using var response = await httpClient.SendAsync(request);
... View more
Hi, Call to Delete contact_lists returns status code 415 response [ { "error_key": "contacts.api.error", "error_message": "The provided content-type 'text\/plain' is not supported." }] Why is content type needed as the call is not providing any request content. Snippet of API client ASP.Net Core 3.1 httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}"); httpClient.DefaultRequestHeaders.Add("Accept", "application/json"); var response = await httpClient.DeleteAsync($"{baseUrl}{apiVersion}/contact_lists/{contactListId}"); var content = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { var jObject = JObject.Parse(content); return mapper.Map<DeleteContactListDto>(jObject); } else logger.Warning(content); Thanks
... View more