Box.V2.Managers.BoxFilesManager.GetDownloadUriAsync C# (CSharp) Метод

GetDownloadUriAsync() публичный Метод

Retrieves the temporary direct Uri to a file (valid for 15 minutes). This is typically used to send as a redirect to a browser to make the browser download the file directly from Box.
public GetDownloadUriAsync ( string id, string versionId = null ) : Task
id string Id of the file.
versionId string Version of the file.
Результат Task
        public async Task<Uri> GetDownloadUriAsync(string id, string versionId = null)
        {
            id.ThrowIfNullOrWhiteSpace("id");

            BoxRequest request = new BoxRequest(_config.FilesEndpointUri, string.Format(Constants.ContentPathString, id)) { FollowRedirect = false }
                .Param("version", versionId);

            IBoxResponse<BoxFile> response = await ToResponseAsync<BoxFile>(request).ConfigureAwait(false);
            var locationUri = response.Headers.Location;

            return locationUri;
        }