Reputation: 2167
We are calling the Odata endpoint from our application. The odata endpoint has few headers needed like below
I am able to add the content on to my application which calls the end point like below
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
Uri uri = new Uri(BaseURL_Core);
client_Core.BaseAddress = uri;
client_Core.DefaultRequestHeaders.Accept.Clear();
client_Core.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client_Core.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray_Core));
How to set here the Prefer
that will set the maxpagesize
Upvotes: 1
Views: 472
Reputation: 4163
Just use method Add
on DefaultRequestHeades
collection to add custom ones.
client_Core.DefaultRequestHeades.Add("Prefer", "odata.maxpagesize=500")
Upvotes: 1