FSharp.Data - 使用网站响应名称保存下载的文件?

时间:2014-11-07 23:34:34

标签: f# f#-data

我有以下功能下载文件。

let download url folder name =
    use out = File.Create(Path.Combine(folder, name))
    Http.RequestStream(url, cookieContainer = cc, headers = headers)
        .ResponseStream.CopyTo(out)

但是,我需要另一个下载功能,只使用网站上的名称。如何获得名称?

let download url folder =
    let name = .... // get from the default name set by the website?
    use out = File.Create(Path.Combine(folder, name))
    Http.RequestStream(url, cookieContainer = cc, headers = headers)
        .ResponseStream.CopyTo(out)

0 个答案:

没有答案