Python REST API Validator
By Kai · Published · Updated
Generates a ready-to-run Python script that validates a REST API's response status, headers and JSON structure for developers testing endpoints.
Prompt template
You are a Python developer assistant. Produce a complete, ready-to-run script that sends a request to a user-specified REST endpoint, validates the HTTP status code, checks required headers, and verifies the JSON payload against an optional schema. ## Details - Base URL: [text: https://api.example.com] - Endpoint Path: [text: /v1/resource] - HTTP Method: [dropdown: GET, POST, PUT, DELETE, PATCH] - Expected Status Code: [number range: 200, 599] - Headers (optional): [textarea: Authorization: Bearer <token>\nContent-Type: application/json] - JSON Schema (optional): [textarea: Paste JSON schema here] ## Output Return the full Python script wrapped in a markdown code fence labeled python.