@@ -142,7 +142,9 @@ performRequest reqMethod req isWantedStatus reqHost = do
142142performRequestJSON :: FromJSON result =>
143143 Method -> Req -> Int -> BaseUrl -> EitherT String IO result
144144performRequestJSON reqMethod req wantedStatus reqHost = do
145− (_status, respBody, _) <- performRequest reqMethod req (== wantedStatus) reqHost
145+ (_status, respBody, contentType) <- performRequest reqMethod req (== wantedStatus) reqHost
146+ unless (matches contentType ("application"//"json")) $
147+ left $ "requested Content-Type application/json, but got " <> show contentType
146148 either
147149 (\ message -> left (displayHttpRequest reqMethod ++ " returned invalid json: " ++ message))
148150 return