2 Replies Latest reply on Jul 2, 2019 7:33 AM by shaharsib

    Create Jenkins http request + Crumb

    shaharsib Novice


      I already managed to get http request working properly - but only with CSRF Protection turned off.

      normal http request with cURL command + CRUMB is looking something like this:

      curl -X POST -H "Jenkins-Crumb:2e03fc96f387abggga6581fe5883a14a" http://My-Jenkins:8080/view/phase_2/job/test_remote_api_triggerring/buildWithParameters?token=MY_TOKEN --user "username:password" 


      In my vRO script the http request looks like this:

      var jobRequest = restHost.createRequest("POST", jobUrlWithToken);

      System.log("jobRequest:  " + jobRequest);

      System.log("jobRequest full Url: " + jobRequest.fullUrl);

      var jobRequestRes = jobRequest.execute();


      which makes the https request looks like this:



      How and where should I placed the crumb token?

      please help..