protected RequestEntity createStringRequestContent ( HTTPRequest httpRequest ) { RequestEntity requestEntity = null ; String contentString = httpRequest . getContentAsString ( ) ; if ( contentString != null ) { try { requestEntity = new StringRequestEntity ( contentString , "text/plain" , null ) ; } catch ( UnsupportedEncodingException exception ) { throw new FaxException ( "Unable to set string request entity." , exception ) ; } } return requestEntity ; }
This function creates a string type request entity and populates it with the data from the provided HTTP request .