c# Dropbox 通过 httpwebrequest 下载文件

标签 c# dropbox dropbox-api

我有一个“ASP.NET”控制台应用程序并且我使用 Dropbox API https://content.dropboxapi.com/1/files/auto/<path> to download content from 我只有 AppKey , AppSecret , Access Token , Token Secretpath文件。

如何使用httpwebrequest发送请求。

最佳答案

我在谷歌搜索,我在 link 中找到了最佳答案:

 string url = String.Format("https://content.dropboxapi.com/1/files/auto{0}?oauth_consumer_key={1}&oauth_token={2}&oauth_signature={3}%26{4}", path, app-key, access-token, app-secret, access-token-secret);
 HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
 webRequest.Method = "Get";
 WebResponse webResponse = null;
  try
  {
     webResponse = webRequest.GetResponse();
     return webResponse.GetResponseStream();
  }
  catch (Exception ex)
  {
    throw ex;       
  }

关于c# Dropbox 通过 httpwebrequest 下载文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34248834/

相关文章:

c# - 如何创建一个接口(interface),在 C# 中保留一些内部方法进行测试?

c# - 带有 if 语句的 Where 子句

c# - ASP MVC 5 和 Bootstrap 中表单控件的对齐不正确

security - 将 DropBox 中的 OAuth 凭据安全地存储在数据库中以供以后使用

c# - 我如何通过 Npgsql 调用 PROCEDURE 中的 OUT 参数

c++ - SQLite 文件锁定和 DropBox

ios - 类型 'NSObject -> () -> ViewController' 的值没有成员 'dbRestClient'

python - Django-storage 将 FileField 和 ImageField 上传到 Dropbox

file-upload - DropboxSDK : What's the benefit of uploadFileChunk: over uploadFile: in DBRestClient?

javascript - 使用 Javascript 中的 Dropbox Core API 将文件上传到 Dropbox