makeRequest :: Keys -> PostData -> GetData -> String -> Request_String
makeRequest k p g res = request
    where
        request = insertHeader apisignHeader md5sum req
        apisignHeader = HdrCustom "apisign"
        md5sum = signURL k url p
        url = makeURL k res g

        req = case p of
            [] -> getRequest url
            _  -> postRequestWithBody url contentType $ makeQuery p

        contentType = "application/x-www-form-urlencoded"
        makeQuery p = L.intercalate "&" $ map eq p
        eq (a, b) = a ++ "=" ++ b
makeRequest :: Keys -> PostData -> GetData -> String -> Request_String
makeRequest k p g res = request
    where
        request = insertHeader apisignHeader md5sum req
        apisignHeader = HdrCustom "apisign"
        md5sum = signURL k url p
        url = makeURL k res g

        req = case p of
            [] -> getRequest url
            _  -> postRequestWithBody url contentType $ makeQuery p

        contentType = "application/x-www-form-urlencoded"
        makeQuery p = L.intercalate "&" $ map eq p
        eq (a, b) = a ++ "=" ++ b
makeRequest k p g res = request
    where
        request = insertHeader apisignHeader md5sum req
        apisignHeader = HdrCustom "apisign"
        md5sum = signURL k url p
        url = makeURL k res g

        req = case p of
            [] -> getRequest url
            _  -> postRequestWithBody url contentType $ makeQuery p

        contentType = "application/x-www-form-urlencoded"
        makeQuery p = L.intercalate "&" $ map eq p
        eq (a, b) = a ++ "=" ++ b