@@ -473,20 +473,12 @@ private void resetMultipartData() {
473473request .parts =null ;
474474 }
475475
476- private void checkIfBodyAllowed () {
477- if ("HEAD" .equals (request .method )) {
478- throw new IllegalArgumentException ("Can NOT set Body on HTTP Request Method HEAD." );
479- }
480- }
481-
482476public T setBody (File file ) {
483- checkIfBodyAllowed ();
484477request .file =file ;
485478return derived .cast (this );
486479 }
487480
488481public T setBody (byte []data )throws IllegalArgumentException {
489- checkIfBodyAllowed ();
490482resetParameters ();
491483resetNonMultipartData ();
492484resetMultipartData ();
@@ -495,7 +487,6 @@ public T setBody(byte[] data) throws IllegalArgumentException {
495487 }
496488
497489public T setBody (String data )throws IllegalArgumentException {
498- checkIfBodyAllowed ();
499490resetParameters ();
500491resetNonMultipartData ();
501492resetMultipartData ();
@@ -504,7 +495,6 @@ public T setBody(String data) throws IllegalArgumentException {
504495 }
505496
506497public T setBody (InputStream stream )throws IllegalArgumentException {
507- checkIfBodyAllowed ();
508498resetParameters ();
509499resetNonMultipartData ();
510500resetMultipartData ();
@@ -517,7 +507,6 @@ public T setBody(EntityWriter dataWriter) {
517507 }
518508
519509public T setBody (EntityWriter dataWriter ,long length )throws IllegalArgumentException {
520- checkIfBodyAllowed ();
521510resetParameters ();
522511resetNonMultipartData ();
523512resetMultipartData ();
@@ -527,7 +516,6 @@ public T setBody(EntityWriter dataWriter, long length) throws IllegalArgumentExc
527516 }
528517
529518public T setBody (BodyGenerator bodyGenerator ) {
530- checkIfBodyAllowed ();
531519request .bodyGenerator =bodyGenerator ;
532520return derived .cast (this );
533521 }