New in 2.4: Test runs you can trust See what's new →

Validierungsfehler

Request-Validierung in ihren gängigen Formen. /register: handgeschriebene Regeln, 422 application/problem+json (RFC 7807) mit Fehlern pro Feld. /strict: lehnt unbekannte Felder (400) und ungültige (422) ab. /annotations: DataAnnotations-Modell; [ApiController] erzeugt das automatische 400 des Frameworks. /problem/{type}: Beispiel-Problem-Dokumente für jeden gängigen Fehlerstatus. Nichts wird gespeichert, derselbe Payload bekommt also immer dieselbe Antwort.

Beispiel-Request

List the sample problem document types. Vollständige Referenz und Send-Button (auf Englisch).

cURL
curl -X GET "https://api.testingapis.com/api/validation/problem"
In Studio ausführen
Antwort · 200 OK
[
  {"type": "bad-request", "status": 400, "url": "/api/validation/problem/bad-request"},
  {"type": "unauthorized", "status": 401, "url": "/api/validation/problem/unauthorized"},
  "… 8 more items"
]