jenkinsci / jenkinsci/java-client-api
Sending POST http request for Job.build(Map<String, String> params, boolean crumbFlag) with crumbFlag=true raised java.lang.IllegalArgumentException: Name may not be null
- Lenguaje dominante
- Java
- Estrellas
- 913
- Forks
- 466
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hi, I am quiet new to Jenkins client API. I'm trying to use the `Job.build` method to kick off a parameterized job with `crumb` flag set to `true`.
However, it threw this exception:
```
java.lang.IllegalArgumentException: Name may not be null
at org.apache.http.util.Args.notNull(Args.java:54)
at org.apache.http.message.BasicHeader.(BasicHeader.java:61)
at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:233)
at com.offbytwo.jenkins.model.Job.build(Job.java:151)
```
Inspecting further in `JenkinsHttpClient.java`, it looks like the issue is with crumb issuer path:
```
Crumb crumb = getQuietly("/crumbIssuer", Crumb.class);
```
Shouldn't this be `crumbIssuer/api/xml` or `crumbIssuer/api/json`??
I can't turn off CSRF in this Jenkins instance, so that's not an option. How can I workaround or fix this issue?
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.