title | description | author | ms.author | ms.date | ms.topic |
---|---|---|---|---|---|
Add additional prefer header webapi v6 |
madansr7 |
saumadan |
7/1/2019 |
article |
Applies To: [!INCLUDEappliesto-webapi]
var requestMessage = new HttpWebRequestMessage(new Uri("https://example.com", UriKind.Absolute));
requestMessage.PreferHeader().ContinueOnError = true;
requestMessage.PreferHeader().MaxPageSize = 1024;
requestMessage.PreferHeader().TrackChanges = true;
Then in the http request header, we will have:
Prefer: odata.continue-on-error,odata.maxpagesize=1024,odata.track-changes
odata.track-changes, odata.maxpagesize, odata.maxpagesize are supported to add in prefer header since ODataLib 6.11.0.