访问Jenkins v2.73.1 crumbIssuer REST API时获取404

Era*_*ara 1 jenkins jenkins-api

我尝试调用Jenkins crumIssuer API,但出现以下错误。使用Jenkins 2.19.1版,而不使用2.73.1版

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /crumbIssuer/api/json. Reason:
<pre>    Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

Rob*_*les 6

您必须Prevent Cross Site Request Forgery exploits在“管理Jenkins”->“配置全局安全性”下启用该选项。