【发布时间】: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