Finaly figure out how to send QueryString as POST via HttpClient but another problem, URi string is too long becosue one of the string is file encoded to ToBase64String
Is posible to convert this solution:
NameValueCollection queryString = System.Web.HttpUtility.ParseQueryString(string.Empty);
queryString.Add("mail_from", FromEmailAddress);
queryString.Add("mail_to", ToEmailAddress);
queryString.Add("mail_Attachment", ZipInBytes);
var response = await client.PostAsync($"/api?{queryString}", null);
Is there any other way how to send very long string? In postman working JSON raw data send to API
{
"mail_from":"value",
"mail_to":"value2,
"mail_Attachment":"very long string"
}
or I'm completely out and its not possible. My goal is send data with file from Outlook to API and save to database.