File tree Expand file tree Collapse file tree 1 file changed +0
-11
lines changed
api/src/main/java/org/asynchttpclient Expand file tree Collapse file tree 1 file changed +0
-11
lines changed Original file line number Diff line number Diff line change @@ -479,20 +479,12 @@ private void resetMultipartData() {
479
479
request .parts = null ;
480
480
}
481
481
482
- private void checkIfBodyAllowed () {
483
- if ("HEAD" .equals (request .method )) {
484
- throw new IllegalArgumentException ("Can NOT set Body on HTTP Request Method HEAD." );
485
- }
486
- }
487
-
488
482
public T setBody (File file ) {
489
- checkIfBodyAllowed ();
490
483
request .file = file ;
491
484
return derived .cast (this );
492
485
}
493
486
494
487
public T setBody (byte [] data ) throws IllegalArgumentException {
495
- checkIfBodyAllowed ();
496
488
resetParameters ();
497
489
resetNonMultipartData ();
498
490
resetMultipartData ();
@@ -501,7 +493,6 @@ public T setBody(byte[] data) throws IllegalArgumentException {
501
493
}
502
494
503
495
public T setBody (String data ) throws IllegalArgumentException {
504
- checkIfBodyAllowed ();
505
496
resetParameters ();
506
497
resetNonMultipartData ();
507
498
resetMultipartData ();
@@ -510,7 +501,6 @@ public T setBody(String data) throws IllegalArgumentException {
510
501
}
511
502
512
503
public T setBody (InputStream stream ) throws IllegalArgumentException {
513
- checkIfBodyAllowed ();
514
504
resetParameters ();
515
505
resetNonMultipartData ();
516
506
resetMultipartData ();
@@ -519,7 +509,6 @@ public T setBody(InputStream stream) throws IllegalArgumentException {
519
509
}
520
510
521
511
public T setBody (BodyGenerator bodyGenerator ) {
522
- checkIfBodyAllowed ();
523
512
request .bodyGenerator = bodyGenerator ;
524
513
return derived .cast (this );
525
514
}
You can’t perform that action at this time.
0 commit comments