我正在使用Nemiro.OAuth类库在C#中集成Dropbox API。假设当我进行 API 调用时出现错误,例如 -
try
{
RequestResult strReq = OAuthUtility.Post
(
"https://api.dropboxapi.com/1/fileops/move",
new HttpParameterCollection
{
{"access_token", "AccessToken"},
{"root", "auto"},
{"from_path", Path.Combine("Path", Name)},
{"to_path", (Path.Combine("Path", MovePath) + Name)}
}
);
if (strReq.StatusCode == 200)
{
}
else
{
}
}
catch ()
{}
如何跟踪此请求的确切错误?如果有人有任何想法,请分享。
应该使用 RequestException。