Finally figured it out. @Vijay's comment gave me an insight where the issue may be. The solution was in the way the request was getting posted. By default, I had the request headers default to 'multipart form data'.
I had to update the post request function to have parameterized contenttype value:
public [return] DoPostRequest([param1], [param2], ContentTypes contentType)
{
...
[httpclient].DefaultRequestHeaders.Add("ContentType", contentType.ToString());
...
}
where: ContentTypes
is
public class ContentTypes
{
public static readonly ContentTypes Name = new("ContentType");
public static readonly ContentTypes JSON = new("application/json");
public static readonly ContentTypes XML = new("application/xml");
public static readonly ContentTypes TEXT = new("text/plain");
public static readonly ContentTypes HTML = new("text/html");
public static readonly ContentTypes FORM_URLENCODED = new("application/x-www-form-urlencoded");
public static readonly ContentTypes MULTIPART_FORM_DATA = new("multipart/form-data");
public string Value { get; }
private ContentTypes(string value) => Value = value;
public ContentTypes()
{
}
public override string ToString() => Value;
}