diff --git a/rest-core.cabal b/rest-core.cabal
--- a/rest-core.cabal
+++ b/rest-core.cabal
@@ -1,5 +1,5 @@
 Name:             rest-core
-Version:          0.27.0.3
+Version:          0.27.1
 Description:      Rest API library.
 Synopsis:         Rest API library.
 Maintainer:       code@silk.co
@@ -17,7 +17,6 @@
     , aeson                     >= 0.7    &&  < 0.8
     , aeson-utils               == 0.2.*
     , bytestring                >= 0.9    &&  < 0.11
-    , cgi                       == 3001.1.*
     , containers                >= 0.3    &&  < 0.6
     , either                    >= 3.4    &&  < 4.2
     , errors                    == 1.4.*
@@ -26,7 +25,6 @@
     , hxt-pickle-utils          == 0.1.*
     , json-schema               == 0.4.*
     , mtl                       >= 2.0    &&  < 2.2
-    , multipart                 == 0.1.*
     , random                    == 1.0.*
     , rest-types                == 1.9.*
     , safe                      >= 0.2    &&  < 0.4
@@ -51,6 +49,7 @@
                     Rest.Error
                     Rest.Handler
                     Rest.Info
+                    Rest.Multipart
                     Rest.Resource
                     Rest.Run
                     Rest.Schema
diff --git a/src/Rest/Dictionary/Combinators.hs b/src/Rest/Dictionary/Combinators.hs
--- a/src/Rest/Dictionary/Combinators.hs
+++ b/src/Rest/Dictionary/Combinators.hs
@@ -54,12 +54,12 @@
 import Data.JSON.Schema
 import Data.Text.Lazy (Text)
 import Data.Typeable
-import Network.Multipart (BodyPart)
 import Text.XML.HXT.Arrow.Pickle
 import qualified Data.Label.Total as L
 
 import Rest.Dictionary.Types
 import Rest.Info
+import Rest.Multipart (BodyPart)
 
 -- | Add custom sub-dictionary for recognizing headers.
 
diff --git a/src/Rest/Dictionary/Types.hs b/src/Rest/Dictionary/Types.hs
--- a/src/Rest/Dictionary/Types.hs
+++ b/src/Rest/Dictionary/Types.hs
@@ -52,11 +52,11 @@
 import Data.Label.Derive
 import Data.Text.Lazy (Text)
 import Data.Typeable
-import Network.Multipart (BodyPart)
 import Text.XML.HXT.Arrow.Pickle
 
 import Rest.Error
 import Rest.Info
+import Rest.Multipart (BodyPart)
 
 -- | The `Format` datatype enumerates all input and output formats we might recognize.
 
diff --git a/src/Rest/Driver/Perform.hs b/src/Rest/Driver/Perform.hs
--- a/src/Rest/Driver/Perform.hs
+++ b/src/Rest/Driver/Perform.hs
@@ -22,7 +22,6 @@
 import Data.Maybe
 import Data.Text.Lazy.Encoding (decodeUtf8)
 import Data.UUID (UUID)
-import Network.Multipart (showMultipartBody, MultiPart(..), BodyPart (..))
 import Safe
 import System.IO.Unsafe
 import System.Random (randomIO)
@@ -40,6 +39,7 @@
 import Rest.Driver.Types
 import Rest.Error
 import Rest.Handler
+import Rest.Multipart (showMultipartBody, MultiPart(..), BodyPart (..))
 import qualified Rest.Dictionary   as D
 import qualified Rest.Driver.Types as Rest
 
diff --git a/src/Rest/Driver/Routing.hs b/src/Rest/Driver/Routing.hs
--- a/src/Rest/Driver/Routing.hs
+++ b/src/Rest/Driver/Routing.hs
@@ -25,8 +25,6 @@
 import Control.Monad.Trans.Either
 import Control.Monad.Trans.Maybe
 import Data.ByteString (ByteString)
-import Network.Multipart (BodyPart (..))
-import Network.CGI.Protocol  (HeaderName (..))
 import Safe
 import qualified Control.Monad.State       as State
 import qualified Data.ByteString.UTF8      as UTF8
@@ -40,6 +38,7 @@
 import Rest.Dictionary
 import Rest.Error
 import Rest.Handler (ListHandler, Handler, GenHandler (..), Env (..), range, mkInputHandler, Range (..))
+import Rest.Multipart (BodyPart (..), HeaderName (..))
 import Rest.Types.Container.Resource (Resource, Resources (..))
 import qualified Rest.Types.Container.Resource as R
 import qualified Rest.Api                      as Rest
diff --git a/src/Rest/Multipart.hs b/src/Rest/Multipart.hs
new file mode 100644
--- /dev/null
+++ b/src/Rest/Multipart.hs
@@ -0,0 +1,53 @@
+-- | Data types for representing and showing multi-part bodies.
+-- Copied from a hidden module in the cgi package.
+module Rest.Multipart
+  ( MultiPart (..)
+  , BodyPart (..)
+  , HeaderName (..)
+  , showMultipartBody
+  ) where
+
+import Data.Char (toLower)
+import Data.ByteString.Lazy.Char8 (ByteString)
+import Data.List (intersperse)
+
+import qualified Data.ByteString.Lazy.Char8 as BS
+
+showMultipartBody :: String -> MultiPart -> ByteString
+showMultipartBody b (MultiPart bs) =
+    unlinesCRLF $ foldr (\x xs -> d:showBodyPart x:xs) [c,BS.empty] bs
+ where d = BS.pack ("--" ++ b)
+       c = BS.pack ("--" ++ b ++ "--")
+
+showBodyPart :: BodyPart -> ByteString
+showBodyPart (BodyPart hs c) =
+    unlinesCRLF $ [BS.pack (n++": "++v) | (HeaderName n,v) <- hs] ++ [BS.empty,c]
+
+
+data MultiPart = MultiPart [BodyPart]
+               deriving (Show, Eq, Ord)
+
+data BodyPart = BodyPart Headers ByteString
+                deriving (Show, Eq, Ord)
+
+-- | HTTP headers.
+type Headers = [(HeaderName, String)]
+
+-- | A string with case insensitive equality and comparisons.
+newtype HeaderName = HeaderName String deriving (Show)
+
+instance Eq HeaderName where
+    HeaderName x == HeaderName y = map toLower x == map toLower y
+
+instance Ord HeaderName where
+    HeaderName x `compare` HeaderName y = map toLower x `compare` map toLower y
+
+--
+-- * RFC 2046 CRLF
+--
+
+crlf :: ByteString
+crlf = BS.pack "\r\n"
+
+unlinesCRLF :: [ByteString] -> ByteString
+unlinesCRLF = BS.concat . intersperse crlf
