Thanks a lot for the rapid response, Now I see it has to be a POST, do you know how to do it with groovy and what import I have to use for that? Thanks.
On Tuesday, August 6, 2013 4:07:00 PM UTC-3, Daniel Beck wrote: > Send a POST request. > > https://en.wikipedia.org/wiki/POST_%28HTTP%29 > > How this works depends on how you send the requests in the first place. > Example using the `curl` command line program: > > curl --data '' 'http://jenkins/queue/cancelItem?id=65' > > `--data` causes the request to be sent as POST, '' means simply that we > send an empty POST body. > > On 06.08.2013, at 20:37, tiago fernandez <[email protected]<javascript:>> > wrote: > > > Hello, > > > > I want to cancel a queue item in a Job that has permissions set. > > I have tried for example to cancel a queue item with ID 65 (I get the ID > from the Queue Api: queue/api/json?pretty=true): > > > > http://<jenkins_server>/queue/cancelItem?id=65 > > > > or using the token that job has set: > > > > http://<jenkins_server>/queue/cancelItem?token=myToken&id=65 > > > > but both throws an error: > > > > javax.servlet.ServletException: java.lang.IllegalAccessException: POST > is required for public org.kohsuke.stapler.HttpResponse > hudson.model.Queue.doCancelItem(int) throws > java.io.IOException,javax.servlet.ServletException at > org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:693) > > .... > > > > How should I use the API to cancel an specific item of a Queue? > > Is token necessary since is Jenkins with permissions set? > > > > Thanks for the help. > > > > -- > > You received this message because you are subscribed to the Google > Groups "Jenkins Users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
