Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.25 KB

additional-prefer-header.md

File metadata and controls

27 lines (20 loc) · 1.25 KB
title description author ms.author ms.date ms.topic
Add additional prefer header webapi v6
madansr7
saumadan
7/1/2019
article

Create request message with prefer header in WebApi

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

Additional information

odata.track-changes, odata.maxpagesize, odata.maxpagesize are supported to add in prefer header since ODataLib 6.11.0.