I have Jenkins and Subversion installed on my Windows 7 localhost. They work fine independently.
I have the Subversion Plugin for Jenkins installed. From this page https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin#SubversionPlugin-Windowsspecificpostcommithook I have post-commit.bat and the vbs script described.
This visual basic code fails:
url = jenkins + "crumbIssuer/api/xml?
xpath=concat(//crumbRequestField,"":"",//crumb)"
Set http = CreateObject("Microsoft.XMLHTTP")
http.open "GET", url, False
With this error:
javax.servlet.ServletException: Must be POST, Can't be GET at hudson.model.AbstractModelObject.requirePOST(AbstractModelObject.java:88)
I think this code is getting the crumb for a CSRF protection token, but failing.
https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API says:
Jenkins uses the "Prevent Cross Site Request Forgery exploits"
security option (which it should), when you make a POST request,
you have to send a CSRF protection token as an HTTP request header.
I didn't turn CSRF protection on, though I know I should, out of simplicity's sake.
* I removed the GET section of the .vbs script file, so that now it just calls the POST section, and doesn't reference the crumb variable or change the request header at all, yet I still get the "Must be POST, Can't be GET" error.
What gives?