/usr/bin/curl -X GET -k --cookie `cat cookie.txt` https://JENKINS_URL/job/MYJOBNAME/lastCompletedBuild/api/xml/ --user usr:token
But it is resulting in 404 error like below
<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 /jenkins/job/Hadoop-y-branch-2.8-3-EndToEnd/lastCompletedBuild/api/xml/. Reason:
<pre> Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>
I also enabled 'Prevent Cross Site Request Forgery exploits' and 'Enable proxy compatibility' in configureSecurity but could not get it to work. Am I missing something obvious?
$ curl --version
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
Any help will be appreciated!
Thanks!