【问题标题】:Error in call to API function "files/download"调用 API 函数“文件/下载”时出错
【发布时间】:2019-01-13 12:10:14
【问题描述】:

我使用 DropBox API 在 Xamarin.Forms(NET 标准)中实现 Dropbox。 我上传文件成功,但下载时出现此错误

Dropbox.Api.BadInputException:调用 API 函数时出错 “文件/下载”:错误的 HTTP“内容类型”标头: “应用程序/x-www-form-urlencoded”。期待“文本/纯文本”之一, "text/plain; charset=utf-8", "application/octet-stream", “应用程序/八位字节流;charset=utf-8”。

using (var client = new DropboxClient(this.AccessToken))
{
    using (var response = await client.Files.DownloadAsync(file.FilePath + "/" + file))
    {
        var pickedFile = await response.GetContentAsByteArrayAsync();
        //FileImagePreview.Source = ImageSource.FromStream(() => pickedFile);
    }
}

【问题讨论】:

    标签: c# xamarin.forms


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2021-09-10
    • 1970-01-01
    • 2016-06-28
    • 1970-01-01
    • 2019-12-11
    • 1970-01-01
    • 2014-07-01
    • 2013-08-31
    相关资源
    最近更新 更多