// In production code, don't destroy the HttpClient through using, but better use IHttpClientFactory factory or at least reuse an existing HttpClient instance
// https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests
// https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api-uploadcsv.com/search/csv/"))
{
var multipartContent = new MultipartFormDataContent();
multipartContent.Add(new ByteArrayContent(File.ReadAllBytes("search.csv")), "data", Path.GetFileName("search.csv"));
multipartContent.Add(new StringContent("adresse"), "columns");
multipartContent.Add(new StringContent("postcode"), "columns");
multipartContent.Add(new StringContent("result_id"), "result_columns");
multipartContent.Add(new StringContent("score"), "result_columns");
request.Content = multipartContent;
var response = await httpClient.SendAsync(request);
}
}