From 900b9f1991e8bc853dc9f78070013064afd6e410 Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Wed, 18 May 2016 00:06:16 -0700 Subject: [PATCH] Explain use of Left value --- src/PostgREST/ApiRequest.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PostgREST/ApiRequest.hs b/src/PostgREST/ApiRequest.hs index e32e5c5cc..6c15852ac 100644 --- a/src/PostgREST/ApiRequest.hs +++ b/src/PostgREST/ApiRequest.hs @@ -122,6 +122,9 @@ userApiRequest schema req reqBody = Nothing -> PayloadParseError "All lines must have same number of fields" Just json -> PayloadJSON json) (CSV.decodeByName reqBody) + -- This is a Left value because form-urlencoded is not a content + -- type which we ever use for responses, only something we handle + -- just this once for requests Left "application/x-www-form-urlencoded" -> PayloadJSON . UniformObjects . V.singleton . M.fromList . map (cs *** JSON.String . cs) . parseSimpleQuery