Download entire folder from Version Control via TFS 2015 RestFul Apis

流过昼夜 提交于 2019-12-02 10:39:30

问题


Is there a way to get the download url for an entire folder from TFS 2015 Version Control using the RestFul apis?

I can get metadata about items via the /_apis//tfvc/items/ api, but no downloadUrl property is available.

I can see the downloadUrl property for build artifacts via the /_apis//build/builds/{buildNumber}/artifacts api.

I could download every file in the folder via the GET api for that item, but that could require a lot of requests.

I am using api version 2.0.


回答1:


There isn't any download url for items/folders with currently Version Control API.

To get an entire folder, you can zip it and download it with the Rest Api with following format:

[Get] https://xxx/defaultcollection/_apis/tfvc/items?path=<Folder Path>&api-version=1.0

And add following in the request header: Accept: application/zip



来源:https://stackoverflow.com/questions/34357671/download-entire-folder-from-version-control-via-tfs-2015-restful-apis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!