Benutzer mit den meisten Antworten
In the zip file at http://blogs.msdn.com/b/astoriateam/archive/2011/10/14/introducing-the-odata-library.aspx the file HTTPResponseSamples.cs uses the method ODataVersion.ToHeaderValue(). However, that method does not exist in the sources on codeplex.
Can you please post the code for this or tell me what format this is supposed to take?
Also what is the purpose of setting the MaxDataServiceVersion? Does this mean if there is an oData 4.0 server, it should not respond to requests that are 2.0 - 3.0?
thanks - dave
Who will win The International Collegiate Programming Championships?
The public method got moved before RTM. It's ODataUtils.ODataVersionToString.
MaxDataServiceVersion (MaxDSV for short)
If you mean the HTTP header (I assume you do)... The header is used by the client to specify the maximum version of OData it understands. It's up to the server what it will do, but it should never respond with a higher version than that.
Most servers will try to use the version which fits into the max version, and if they can't, they will fail the request.
It does NOT mean that V3 server will not response to a request with MaxDSV set to V2. It only means that if the server would have to respond with V3 features in the payload, it would fail such a request. But if the response contains only V2 features, it should reply with a V2 response.
All clients should specify the header in all requests. So please do so :-). (It gets really tricky if the client doesn't do that and the server changes version and so on).
Vitek Karas [MSFT]