【问题标题】:400 Bad Request Error when send submitting Multiple wiki pages through Azure Devops通过 Azure Devops 发送提交多个 wiki 页面时出现 400 错误请求错误
【发布时间】:2021-10-10 00:16:23
【问题描述】:

我正在尝试通过 Azure Devops 同时发送多个 wiki 页面,但是当我尝试这样做时收到 400 Bad Request 错误,这不可能吗?看来我需要等待任务完成才能发送新消息。

HttpClient client = new();
for(int i=0;i<10;i++)
{
   HttpRequestMessage message = new HttpRequestMessage()
   {
      Content = "\"content\": \"Hello World!\"",
      Method = HttpMethod.Put,
      RequestUri = new Uri(@"https://dev.azure.com/organization/project/_apis/wiki/wikis?api- 
   version=6.0")
   };
   client.SendAsync(message);
}

【问题讨论】:

  • 当 Azure Devops 返回 400 时,您是否检查了响应正文并返回了确切的错误?

标签: c# azure-devops dotnet-httpclient


【解决方案1】:

在 Azure Devops 中,Wiki 类似于另一种 Repo。你可以Clone Wiki 到目标项目和Publish the code as wiki

步骤如下:

  1. 使用 Clone wiki 选项从其他项目获取 URL。

2.导航到目标项目-> Repos。使用 import repositoryoption 将 wiki 导入到 Repo。

  1. 使用 Publish Code as wiki 选项将 repo 发布为 wiki 页面。

更多信息可以参考link

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-30
    • 2016-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    • 1970-01-01
    相关资源
    最近更新 更多