@@ -77,7 +77,7 @@ prependToPathParts p req =
77 req { reqPathParts = p : reqPathParts req }
77 req { reqPathParts = p : reqPathParts req }
79addHeader :: (ToHttpApiData a, Reflex t) => Text -> Dynamic t (Either Text a) -> Req t -> Req t
79addHeader :: (ToHttpApiData a, Reflex t) => Text -> Dynamic t (Either Text a) -> Req t -> Req t
80−addHeader name val req = req { headers = (name, (fmap . fmap) (unpack . toHeader) val) : headers req }
80+addHeader name val req = req { headers = (name, (fmap . fmap) toHeader val) : headers req }
83-- * performing requests
83-- * performing requests
@@ -144,14 +144,20 @@ performRequest reqMeth req reqHost trigger = do
145 mkConfigBody :: Either Text [(Text,Text)]
145 mkConfigBody :: Either Text [(Text,Text)]
146 -> (Either Text (BL.ByteString, Text))
146 -> (Either Text (BL.ByteString, Text))
147− -> Either Text XhrRequestConfig
147+ -> Either Text (XhrRequestConfig LT.Text)
148 mkConfigBody ehs rb = case (ehs, rb) of
148 mkConfigBody ehs rb = case (ehs, rb) of
149 (_, Left e) -> Left e
149 (_, Left e) -> Left e
150 (Left e, _) -> Left e
150 (Left e, _) -> Left e
151 (Right hs, Right (bBytes, bCT)) ->
151 (Right hs, Right (bBytes, bCT)) ->
152+ Right $ XhrRequestConfig
152− Right $ def { _xhrRequestConfig_sendData = Just (BL.unpack bBytes)
153+ { _xhrRequestConfig_sendData = Just (BL.unpack bBytes)
153− , _xhrRequestConfig_headers =
154+ , _xhrRequestConfig_headers =
154− Map.insert "Content-Type" bCT (Map.fromList hs)}
155+ Map.insert "Content-Type" bCT (Map.fromList hs)
156+ , _xhrRequestConfig_password = Nothing
157+ , _xhrRequestConfig_responseType = Nothing
158+ , _xhrRequestConfig_withCredentials = False
159+ , _xhrRequestConfig_responseHeaders = def
156 xhrOpts :: Dynamic t (Either Text (XhrRequestConfig LT.Text))
162 xhrOpts :: Dynamic t (Either Text (XhrRequestConfig LT.Text))
157 xhrOpts = case reqBody req of
163 xhrOpts = case reqBody req of