HttpClient client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri($"https://listing-external-sit.hepsiburada.com/Listings/merchantid/*******/sku/*******/merchantsku/*********"),
Headers =
{
{ "authorization", "Basic *********************" },
{"User-Agent", "*************" }
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
MessageBox.Show(body);
}
Even though I entered the required basic authorization and headers information on both sides, I get an error when I delete via Postman, but when I delete using C#, I get an unauthorized error.
New contributor
Erkan Demir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.