Controllo delle versioni
Ogni richiesta client deve fornire una versione API esplicita come parametro stringa di query. Ad esempio: https://{myconfig}.azconfig.io/kv?api-version=1.0
.
api-version
è espresso in formato SemVer (major.minor). La negoziazione dell'intervallo o della versione non è supportata.
Questo articolo si applica all'API versione 1.0.
Di seguito viene descritto un riepilogo delle possibili risposte di errore restituite dal server quando la versione dell'API richiesta non può essere corrispondente.
Versione DELL'API non specificata
Questo errore si verifica quando un client effettua una richiesta senza fornire una versione dell'API.
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8
{
"type": "https://azconfig.io/errors/invalid-argument",
"title": "API version is not specified",
"name": "api-version",
"detail": "An API version is required, but was not specified.",
"status": 400
}
Versione dell'API non supportata
Questo errore si verifica quando una versione dell'API richiesta da un client non corrisponde a nessuna delle versioni API supportate dal server.
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8
{
"type": "https://azconfig.io/errors/invalid-argument",
"title": "Unsupported API version",
"name": "api-version",
"detail": "The HTTP resource that matches the request URI '{request uri}' does not support the API version '{api-version}'.",
"status": 400
}
Versione dell'API non valida
Questo errore si verifica quando un client effettua una richiesta con una versione dell'API, ma il valore è non valido o non può essere analizzato dal server.
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8
{
"type": "https://azconfig.io/errors/invalid-argument",
"title": "Invalid API version",
"name": "api-version",
"detail": "The HTTP resource that matches the request URI '{request uri}' does not support the API version '{api-version}'.",
"status": 400
}
Versione dell'API ambigua
Questo errore si verifica quando un client richiede una versione DELL'API ambigua al server, ad esempio più valori diversi.
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8
{
"type": "https://azconfig.io/errors/invalid-argument",
"title": "Ambiguous API version",
"name": "api-version",
"detail": "The following API versions were requested: {comma separated api versions}. At most, only a single API version may be specified. Please update the intended API version and retry the request.",
"status": 400
}