--- | Issue a GET request to an URL and returns
--- the response body as a String or Nothing on failure.
--- If 'followRedirections' is set to True, new requests
--- will be made on 3XX response codes to the Location of
+-- | Issue a @GET@ request to an URL given as first parameter
+-- and returns the response body as a 'String' or 'Nothing'
+-- If the second argument is set to 'True', and a @3XX@
+-- response code is found, a new request will be made
+-- to the @Location@ header of the response.
scGet :: String -> Bool -> IO (Maybe String)
scGet url followRedirections =
do res <- simpleHTTP $ getRequest url
--- | Issue a GET request to 'dUrl' and save the response body
--- to a file in the path indicated by the 'out' parameter
+-- | Given an URL as a first parameter, and a path as a second,
+-- issue a @GET@ request to the @URL@ and save the response body
scFetch :: String -> String -> IO ()
do contents <- scGet dUrl True
-- | Given an arbitrary resource URL, returns the type of the
-- The response can be one of:
scResourceType :: String -> String
scResourceType url | tracksURL `isPrefixOf` url = "track"
| usersURL `isPrefixOf` url = "user"
-- | Get the API url of a resource given its public URL.
-- In example, for a public URL like:
-- It returns the API URL:
scResolve :: String -> IO String
do dat <- scGet resolveUrl False