public IActionResult DownloadToOneDrive([FromBody] DownloadToOneDriveRequest request) { try { _searchService.DownloadSongToOneDrive(request.SongId); return(Ok()); } catch (Exception e) { _logger.LogError(e, "Error in DownloadToOneDrive"); return(BadRequest()); } }
public async Task <bool> DownloadToOneDrive(DownloadToOneDriveRequest request) { try { var result = await _searchClient.PutAsync("DownloadToOneDrive", HttpClientHelper.GetJsonData(request)); return(result.IsSuccessStatusCode); } catch (Exception e) { return(HttpClientHelper.LogError <bool>(_logger, e, new object[] { request.SongId })); } }