var objectContent = new ObjectContent<Dictionary<string, DataTable>>(dataTablesDic, new JsonMediaTypeFormatter(), "application/json");
var json = Newtonsoft.Json.JsonConvert.SerializeObject(dataTablesDic);
//setting request's content ContentLength's header was the only way I found to turn off .net core automatic Transfer-Encoding=Chunked setting, which was resulting in web api post object binding failure
objectContent.Headers.ContentLength = Encoding.UTF8.GetByteCount(json);
var result = httpClient.PostAsync($"http://localhost:65000/File/GetExcel?bucketDestinationPath={fileName}&S3bucketName=myBuketName", objectContent)?.Result;
No comments:
Post a Comment