{"record":{"id":"00d72ba281ec6920","repo":"clockworklabs/SpacetimeDB","slug":"http-response-from-url-url-was-success-but-did","errorCode":null,"errorMessage":"HTTP response from url ({url}) was success but did not have content-type: {content_type}","messagePattern":"HTTP response from url \\((.+?)\\) was success but did not have content-type: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/util.rs","lineNumber":83,"sourceCode":"        Some(\"HTTP status server error\")\n    } else {\n        Some(\"unexpected HTTP status code\")\n    }\n}\n\nimpl ResponseExt for reqwest::Response {\n    async fn ensure_content_type(self, content_type: &str) -> anyhow::Result<Self> {\n        let status = self.status();\n        if self\n            .headers()\n            .get(http::header::CONTENT_TYPE)\n            .is_some_and(|ty| ty == content_type)\n        {\n            return Ok(self);\n        }\n        let url = self.url();\n        let Some(status_desc) = err_status_desc(status) else {\n            anyhow::bail!(\"HTTP response from url ({url}) was success but did not have content-type: {content_type}\");\n        };\n        let url = url.to_string();\n        let status_err = match self.error_for_status_ref() {\n            Err(e) => anyhow::Error::from(e),\n            Ok(_) => anyhow::anyhow!(\"{status_desc} ({status}) from url ({url})\"),\n        };\n        let err = match self.text().await {\n            Ok(text) => status_err.context(text),\n            Err(err) => anyhow::Error::from(err)\n                .context(format!(\"{status_desc} ({status})\"))\n                .context(\"failed to get response text\"),\n        };\n        Err(err)\n    }\n\n    async fn json_or_error<T: serde::de::DeserializeOwned>(self) -> anyhow::Result<T> {\n        let status = self.status();\n        self.ensure_content_type(\"application/json\")","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/util.rs#L65-L101","documentation":"Error \"HTTP response from url ({url}) was success but did not have content-type: {content_type}\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/cli/src/util.rs:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}