callAPI' :: Token -> Request -> EnumHttpClient -> IO (Result JSValue)
callAPI' tok req client = (runOAuthM tok $ do
    putToken tok
    debug req
    resp <- signRq2 HMACSHA1 Nothing req >>= serviceRequest client
    --debug resp
    case status resp of
        200 -> return $ decode $ BU.toString $ rspPayload resp
        -- maybe connection error
        0   -> return $ Error "unknown error"
        _   -> return $ Error $ show (status resp) ++ " " ++ show (reason resp))
  `catch` (\e -> return $ Error $ show e)
callAPI' :: Token -> Request -> EnumHttpClient -> IO (Result JSValue)
callAPI' tok req client = (runOAuthM tok $ do
    putToken tok
    debug req
    resp <- signRq2 HMACSHA1 Nothing req >>= serviceRequest client
    --debug resp
    case status resp of
        200 -> return $ decode $ BU.toString $ rspPayload resp
        -- maybe connection error
        0   -> return $ Error "unknown error"
        _   -> return $ Error $ show (status resp) ++ " " ++ show (reason resp))
  `catch` (\e -> return $ Error $ show e)
callAPI' tok req client = (runOAuthM tok $ do
    putToken tok
    debug req
    resp <- signRq2 HMACSHA1 Nothing req >>= serviceRequest client
    --debug resp
    case status resp of
        200 -> return $ decode $ BU.toString $ rspPayload resp
        -- maybe connection error
        0   -> return $ Error "unknown error"
        _   -> return $ Error $ show (status resp) ++ " " ++ show (reason resp))
  `catch` (\e -> return $ Error $ show e)