jenkinsci / jenkinsci/java-client-api

status code: 414, reason phrase: Request-URI Too Large

Open
#462 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
913
Forks
466
PR merge metrics
No merged PRs in 30d

Description

`org.apache.http.client.HttpResponseException: status code: 414, reason phrase: Request-URI Too Large
at com.offbytwo.jenkins.client.validator.HttpResponseValidator.validateResponse(HttpResponseValidator.java:11)
at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:261)
at com.offbytwo.jenkins.model.Job.build(Job.java:151)
at com.offbytwo.jenkins.model.Job.build(Job.java:113)`

when build job with params, The parameter is a very long value, there will be the following error.In the source code, although the operation is a post request, he stitched the parameters on the url.

` public QueueReference build(Map params, Map fileParams, boolean crumbFlag) throws IOException {
String qs = join(Collections2.transform(params.entrySet(), new MapEntryToQueryStringPair()), "&");
ExtractHeader location = client.post(url + "buildWithParameters?" + qs,null, ExtractHeader.class, fileParams, crumbFlag);
return new QueueReference(location.getLocation());
}`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.