Limit on batch size to 20 individual requests.
Our application is consuming Graph URL for image .If application is placing request for more than 20 images in a single call ,the request is failing.
C# Code:
string graphUrl = ConfigurationManager.AppSettings["GraphURL"];
var batchData = JsonConvert.SerializeObject(GetBatchRequest(modifiedUserCount));
var json = new StringContent(batchData, Encoding.UTF8, "application/json");
var watch = new System.Diagnostics.Stopwatch();
watch.Start();
HttpResponseMessage result = httpClient.PostAsync(graphUrl, json).Result;
watch.Stop();
Debug.WriteLine("Timer: " + watch.ElapsedMilliseconds.ToString());
if (result.IsSuccessStatusCode)
{
//This part of loop is never executed as IsSuccessStatusCode is false.
}
How can we resolve this issue? Do we need to split our request into multiples ,each with 20 maximum image requests?