[英]Add files/folder to Visual Studio Team Services (was TFS Online) using API from MVC application C#
I am trying to upload a file to Visual Studio Team Services using RestAPI from an MVC C# based application. 我试图从基于MVC C#的应用程序中使用RestAPI将文件上传到Visual Studio Team Services。 But not able to get the how to upload or add a file or create a folder using api.
但是无法获取如何使用api上传或添加文件或创建文件夹的方法。
Can anyone please let me know what api method do I need to call to perform this action. 谁能让我知道执行此操作需要调用哪些api方法。
As per my understanding the files that we add in Team Services, via api we can call from Version Control Items ( https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items ), from this api I understand that we can get the item and its metadata. 据我了解,我们通过api从Team Control中添加的文件可以从Version Control Items( https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items )中调用api我知道我们可以获取该项目及其元数据。 But how to upload an file/folder?
但是如何上传文件/文件夹?
Thanks in Advance! 提前致谢!
If you are using Git as source control, you can use this API to add, edit, rename, move, and delete files in a Git repository. 如果将Git用作源代码管理,则可以使用此API在Git存储库中添加,编辑,重命名,移动和删除文件。 You can either make changes in an existing branch or create a new one.
您可以在现有分支中进行更改,也可以创建一个新分支。
If you are using TFVC as source control, there is no related REST API can achieve for now. 如果您将TFVC用作源代码控制,则目前尚无相关的REST API。 However you can use Team Foundation version control commands as a workaround, Checkin command should do the trick.
但是,您可以使用Team Foundation版本控制命令作为解决方法, Checkin命令应该可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.