Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ce19bb

Browse files
author
Stephane Landelle
committed
Remove RequestBuilderBase.checkIfBodyAllowed,closeAsyncHttpClient#455
1 parent99da52b commit6ce19bb

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

‎src/main/java/com/ning/http/client/RequestBuilderBase.java‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -473,20 +473,12 @@ private void resetMultipartData() {
473473
request.parts =null;
474474
}
475475

476-
privatevoidcheckIfBodyAllowed() {
477-
if ("HEAD".equals(request.method)) {
478-
thrownewIllegalArgumentException("Can NOT set Body on HTTP Request Method HEAD.");
479-
}
480-
}
481-
482476
publicTsetBody(Filefile) {
483-
checkIfBodyAllowed();
484477
request.file =file;
485478
returnderived.cast(this);
486479
}
487480

488481
publicTsetBody(byte[]data)throwsIllegalArgumentException {
489-
checkIfBodyAllowed();
490482
resetParameters();
491483
resetNonMultipartData();
492484
resetMultipartData();
@@ -495,7 +487,6 @@ public T setBody(byte[] data) throws IllegalArgumentException {
495487
}
496488

497489
publicTsetBody(Stringdata)throwsIllegalArgumentException {
498-
checkIfBodyAllowed();
499490
resetParameters();
500491
resetNonMultipartData();
501492
resetMultipartData();
@@ -504,7 +495,6 @@ public T setBody(String data) throws IllegalArgumentException {
504495
}
505496

506497
publicTsetBody(InputStreamstream)throwsIllegalArgumentException {
507-
checkIfBodyAllowed();
508498
resetParameters();
509499
resetNonMultipartData();
510500
resetMultipartData();
@@ -517,7 +507,6 @@ public T setBody(EntityWriter dataWriter) {
517507
}
518508

519509
publicTsetBody(EntityWriterdataWriter,longlength)throwsIllegalArgumentException {
520-
checkIfBodyAllowed();
521510
resetParameters();
522511
resetNonMultipartData();
523512
resetMultipartData();
@@ -527,7 +516,6 @@ public T setBody(EntityWriter dataWriter, long length) throws IllegalArgumentExc
527516
}
528517

529518
publicTsetBody(BodyGeneratorbodyGenerator) {
530-
checkIfBodyAllowed();
531519
request.bodyGenerator =bodyGenerator;
532520
returnderived.cast(this);
533521
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp