Udostępnij za pośrednictwem


Przechowywanie wersji

Każde żądanie klienta musi podać jawną wersję interfejsu API jako parametr ciągu zapytania. Na przykład: https://{myconfig}.azconfig.io/kv?api-version=1.0.

api-version jest wyrażona w formacie SemVer (wersja główna.pomocnicza). Negocjowanie zakresu lub wersji nie jest obsługiwane.

Ten artykuł dotyczy interfejsu API w wersji 1.0.

Poniżej przedstawiono podsumowanie możliwych odpowiedzi na błędy zwróconych przez serwer, gdy nie można dopasować żądanej wersji interfejsu API.

Nieokreślona wersja interfejsu API

Ten błąd występuje, gdy klient wysyła żądanie bez podawania wersji interfejsu 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
}

Nieobsługiwana wersja interfejsu API

Ten błąd występuje, gdy klient zażądał wersji interfejsu API nie jest zgodny z żadną z obsługiwanych wersji interfejsu API przez serwer.

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
}

Nieprawidłowa wersja interfejsu API

Ten błąd występuje, gdy klient wysyła żądanie z wersją interfejsu API, ale wartość jest źle sformułowana lub nie może być analizowana przez serwer.

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
}

Niejednoznaczna wersja interfejsu API

Ten błąd występuje, gdy klient żąda wersji interfejsu API, która jest niejednoznaczna dla serwera (na przykład wiele różnych wartości).

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
}