public MakeDeleteRequestWithAuthTestAsync ( String method ) : Task |
||
method | String | The method to call |
리턴 | Task |
public virtual async Task<RequestResponse> MakeDeleteRequestWithAuthTestAsync(String method)
{
var response = await MakeDeleteRequestAsync(method);
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
{
await RefreshTokenAsync();
response = await MakeDeleteRequestAsync(method);
}
return response;
}
/// <summary> /// Unclaims the Device asynchronous. /// </summary> /// <returns></returns> public async Task <Result> UnclaimAsync() { try { var result = await cloud.MakeDeleteRequestWithAuthTestAsync($"devices/{Id}"); return(result.AsResult()); } catch (HttpRequestException re) { return(new Result { Success = false, Error = re.Message, Exception = re }); } }