protected void setRequestContent ( HTTPRequest httpRequest , HttpMethodBase httpMethodClient ) { //set content if ( httpMethodClient instanceof EntityEnclosingMethod ) { EntityEnclosingMethod pushMethod = ( EntityEnclosingMethod ) httpMethodClient ; RequestEntity requestEntity = null ; ContentType contentType = httpRequest . getContentType ( ) ; switch ( contentType ) { case STRING : requestEntity = this . createStringRequestContent ( httpRequest ) ; break ; case BINARY : requestEntity = this . createBinaryRequestContent ( httpRequest ) ; break ; case MULTI_PART : requestEntity = this . createMultiPartRequestContent ( httpRequest , httpMethodClient ) ; break ; default : throw new FaxException ( "Unsupported content type: " + contentType ) ; } //set request data if ( requestEntity != null ) { pushMethod . setRequestEntity ( requestEntity ) ; pushMethod . setContentChunked ( false ) ; } } }
This function sets the request content .