jenkinsci / jenkinsci/java-client-api

Job.build(Map<String, String> params) results in HTTP 414 (URI too long)

オープン
#352 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
913
フォーク
466
PR マージ指標
30日以内にマージされた PR はありません

説明

I've had problems with requests for a parameterized job build:

```
org.apache.http.client.HttpResponseException: Request-URI Too Long
at com.offbytwo.jenkins.client.validator.HttpResponseValidator.validateResponse(HttpResponseValidator.java:11)
at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:232)
at com.offbytwo.jenkins.model.Job.build(Job.java:125)
at com.offbytwo.jenkins.model.Job.build(Job.java:112)
```

Looking at the code, I noticed that `Job.build` encodes the job parameter/values in the URL.
This can result in a very long URL that exceeds the server's max URL size.

I worked around this problem outside of the library by submitting a POST request where the job parameter/values are passed as form data instead of encoded in the url.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。