简体   繁体   中英

c# Dropbox download file by httpwebrequest

I have an 'ASP.NET' console application and I use Dropbox API https://content.dropboxapi.com/1/files/auto/<path> to download content from I just have the AppKey , AppSecret , Access Token , Token Secret and the path of file.

How to send request with httpwebrequest.

I search in google and i found the best answer in 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;       
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM