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() {
479479 request .parts  = null ;
480480 }
481481
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- 
488482 public  T  setBody (File  file ) {
489-  checkIfBodyAllowed ();
490483 request .file  = file ;
491484 return  derived .cast (this );
492485 }
493486
494487 public  T  setBody (byte [] data ) throws  IllegalArgumentException  {
495-  checkIfBodyAllowed ();
496488 resetParameters ();
497489 resetNonMultipartData ();
498490 resetMultipartData ();
@@ -501,7 +493,6 @@ public T setBody(byte[] data) throws IllegalArgumentException {
501493 }
502494
503495 public  T  setBody (String  data ) throws  IllegalArgumentException  {
504-  checkIfBodyAllowed ();
505496 resetParameters ();
506497 resetNonMultipartData ();
507498 resetMultipartData ();
@@ -510,7 +501,6 @@ public T setBody(String data) throws IllegalArgumentException {
510501 }
511502
512503 public  T  setBody (InputStream  stream ) throws  IllegalArgumentException  {
513-  checkIfBodyAllowed ();
514504 resetParameters ();
515505 resetNonMultipartData ();
516506 resetMultipartData ();
@@ -519,7 +509,6 @@ public T setBody(InputStream stream) throws IllegalArgumentException {
519509 }
520510
521511 public  T  setBody (BodyGenerator  bodyGenerator ) {
522-  checkIfBodyAllowed ();
523512 request .bodyGenerator  = bodyGenerator ;
524513 return  derived .cast (this );
525514 }
                                 You can’t perform that action at this time. 
               
                  
0 commit comments