簡體   English   中英

c#Dropbox下載文件由httpwebrequest提供

[英]c# Dropbox download file by httpwebrequest

我有一個'ASP.NET'控制台應用程序,我使用Dropbox API https://content.dropboxapi.com/1/files/auto/<path> to download content from我只有AppKeyAppSecretAccess TokenToken Secret https://content.dropboxapi.com/1/files/auto/<path> to download content from Token Secret和文件的path

如何使用httpwebrequest發送請求。

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

 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;       
  }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM