@@ -30,6 +30,7 @@ import Data.Argonaut.Core (Json)
3030import Data.Argonaut.Core as J
3131import Data.Argonaut.Parser (jsonParser )
3232import Data.Array as Arr
33+ import Data.ArrayBuffer.Types (ArrayView )
3334import Data.Either (Either (..), either )
3435import Data.Foldable (any )
3536import Data.FormURLEncoded as FormURLEncoded
@@ -49,6 +50,9 @@ import Effect.Exception (Error, error)
4950import Effect.Ref as Ref
5051import Foreign (F , Foreign , ForeignError (..), fail , unsafeReadTagged , unsafeToForeign )
5152import Math as Math
53+ import Web.DOM (Document )
54+ import Web.File.Blob (Blob )
55+ import Web.XHR.FormData (FormData )
5256
5357-- | A record that contains all the information to perform an HTTP request.
5458-- | Instead of constructing the record from scratch it is often easier to build
@@ -266,13 +270,13 @@ request req = do
266270
267271 extractContent :: RequestBody.RequestBody -> Foreign
268272 extractContent = case _ of
269- RequestBody.ArrayView f → f unsafeToForeign
270- RequestBody.Blob x → unsafeToForeign x
271- RequestBody.Document x → unsafeToForeign x
272- RequestBody.String x → unsafeToForeign x
273- RequestBody.FormData x → unsafeToForeign x
274- RequestBody.FormURLEncoded x → unsafeToForeign (FormURLEncoded .encode x)
275- RequestBody.Json x → unsafeToForeign (J .stringify x)
273+ RequestBody.ArrayView f → f ( unsafeToForeign :: forall a . ArrayView a -> Foreign )
274+ RequestBody.Blob x → ( unsafeToForeign :: Blob -> Foreign ) x
275+ RequestBody.Document x → ( unsafeToForeign :: Document -> Foreign ) x
276+ RequestBody.String x → ( unsafeToForeign :: String -> Foreign ) x
277+ RequestBody.FormData x → ( unsafeToForeign :: FormData -> Foreign ) x
278+ RequestBody.FormURLEncoded x → ( unsafeToForeign :: String -> Foreign ) (FormURLEncoded .encode x)
279+ RequestBody.Json x → ( unsafeToForeign :: String -> Foreign ) (J .stringify x)
276280
277281 headers :: Maybe RequestBody.RequestBody -> Array RequestHeader
278282 headers reqContent =
0 commit comments