使用 mantisbt REST 时出错 API

Error using mantisbt REST API

我在装有 IIS 8.5 和 php 版本 7.0.21 的 Windows 服务器上使用 Mantis 2.11.1。我启用了 REST API($g_webservice_rest_enabled = ON;),创建了一个 api-token 并使用 Postman 测试了 API。

对于 http://srvmantis.polymania.com/mantisbt/api/rest/Issues 与 header Authorization:myAPIKey 的调用,结果是“404 - 找不到文件或目录”。

我遇到了同样的问题,我是这样解决的: 首先 install/enable URL 如果你还没有 IIS 重写 然后把它放在 system.webServer 部分的 Mantis web.config 中:

<rewrite>
    <rules>
      <rule name="redirect to api" stopProcessing="true">
        <match url="(.*)" />
        <conditions>
                      <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        </conditions>
        <action type="Rewrite" url="api/rest/index.php/{R:1}" />
      </rule>
    </rules>
  </rewrite>

希望这对您有所帮助

再见 克里斯蒂安