added deleteById

This commit is contained in:
skilion 2015-09-06 10:23:32 +02:00
commit 61c5ea7789

View file

@ -192,6 +192,17 @@ final class OneDriveApi
return result;
}
//https://dev.onedrive.com/items/delete.htm
void deleteById(const(char)[] id, const(char)[] eTag = null)
{
checkAccessTokenExpired();
char[] url = itemByIdUrl ~ id;
if (eTag) http.addRequestHeader("If-Match", eTag);
del(url, http);
// remove the if-match header
if (eTag) setAccessToken(accessToken);
}
private void redeemToken(const(char)[] authCode)
{
string postData = "client_id=" ~ clientId ~ "&redirect_url=" ~ redirectUrl ~ "&client_secret=" ~ clientSecret;