{"record":{"id":"9c58c95286d5a55a","repo":"BerriAI/litellm","slug":"only-post-requests-are-supported","errorCode":null,"errorMessage":"Only POST requests are supported","messagePattern":"Only POST requests are supported","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/deepeval/api.py","lineNumber":68,"sourceCode":"    BASELINE_ATTACKS_ENDPOINT = \"/generate-baseline-attacks\"\n\n\nclass Api:\n    def __init__(self, api_key: str, base_url=None):\n        self.api_key = api_key\n        self._headers = {\n            \"Content-Type\": \"application/json\",\n            # \"User-Agent\": \"Python/Requests\",\n            \"CONFIDENT_API_KEY\": api_key,\n        }\n        # using the global non-eu variable for base url\n        self.base_api_url = base_url or API_BASE_URL\n        self.sync_http_handler = HTTPHandler()\n        self.async_http_handler = get_async_httpx_client(llm_provider=httpxSpecialProvider.LoggingCallback)\n\n    def _http_request(self, method: str, url: str, headers=None, json=None, params=None):\n        if method != \"POST\":\n            raise Exception(\"Only POST requests are supported\")\n        try:\n            self.sync_http_handler.post(\n                url=url,\n                headers=headers,\n                json=json,\n                params=params,\n            )\n        except httpx.HTTPStatusError as e:\n            raise Exception(f\"DeepEval logging error: {e.response.text}\")\n        except Exception as e:\n            raise e\n\n    def send_request(self, method: HttpMethods, endpoint: Endpoints, body=None, params=None):\n        url: Final = f\"{self.base_api_url}{endpoint.value}\"\n        res: Final = self._http_request(\n            method=method.value,\n            url=url,\n            headers=self._headers,","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/deepeval/api.py#L50-L86","documentation":"litellm's vendored DeepEval/Confident-AI Api client implements only POST: _http_request hard-fails on any other method string before any network I/O. It exists as a guard against porting call sites from the official deepeval SDK, where GET/PUT/DELETE are supported for some endpoints.","triggerScenarios":"Calling api.send_request(HttpMethods.GET, Endpoints.PROMPT_ENDPOINT, ...) or any non-POST verb; code migrated from the official confident-ai/deepeval client that fetches or deletes resources.","commonSituations":"Developers assuming the vendored client mirrors deepeval's full REST surface; automated call-site refactors switching the HttpMethods enum value.","solutions":["Use HttpMethods.POST for every send_request call through this vendored client","If you need GET/PUT/DELETE against Confident AI, use the official deepeval SDK (pip install deepeval) or a plain httpx client instead"],"exampleFix":"# before\napi.send_request(HttpMethods.GET, Endpoints.PROMPT_ENDPOINT, params={\"id\": p})  # Exception\n\n# after (official SDK for reads)\nfrom deepeval.confident_api import ...  # or plain httpx GET\n# vendored client stays POST-only:\napi.send_request(HttpMethods.POST, Endpoints.TRACING_ENDPOINT, body=trace)","handlingStrategy":"type-guard","validationCode":"from litellm.integrations.deepeval.api import HttpMethods\n\ndef assert_post(method: HttpMethods) -> None:\n    if method is not HttpMethods.POST:\n        raise ValueError(f\"vendored DeepEval client is POST-only, got {method}\")","typeGuard":"from litellm.integrations.deepeval.api import HttpMethods\nfrom typing import Any\n\ndef is_supported_method(method: Any) -> bool:\n    \"\"\"Narrow to the only verb the vendored client implements.\"\"\"\n    return method is HttpMethods.POST","tryCatchPattern":null,"preventionTips":["Keep a project lint/enum whitelist: only HttpMethods.POST may reach send_request","Route read/delete flows to the official deepeval SDK, not this vendored client","Add a unit test asserting new call sites never pass non-POST verbs"],"tags":["deepeval","http-method","api-client","unsupported-operation"],"backgroundTag":"unsupported-http-method","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}