HttpVersionPolicy
enum cAlgo.API
DesktopCLICloud
An enumeration of different HTTP version policies.
Definition
public enum HttpVersionPolicy
Namespace: cAlgo.API · Group: HTTP
Examples
var request = new HttpRequest(new Uri("https://api.example.com/quotes"))
{
Version = new Version(2, 0),
VersionPolicy = HttpVersionPolicy.RequestVersionOrLower
};
Print("Status code: {0}", Http.Send(request).StatusCode);
from System import Uri, Version
request = HttpRequest(Uri("https://api.example.com/quotes"))
request.Version = Version(2, 0)
request.VersionPolicy = HttpVersionPolicy.RequestVersionOrLower
api.Print(f"Status code: {api.Http.Send(request).StatusCode}")
Values
| Name | Value | Description |
|---|---|---|
RequestVersionOrLower | 0 | Use the requested version or downgrade to a lower one. This is the default behavior. |
RequestVersionOrHigher | 1 | Use the highest available version, downgrading only to the requested version but not below. |
RequestVersionExact | 2 | Only use the requested version. |