@ -335,7 +335,7 @@ public class HTTPClient {
* /
public byte [ ] GETbytes ( final MultiProtocolURI url , final int maxBytes ) throws IOException {
final boolean localhost = url . getHost ( ) . equals ( "localhost" ) ;
final String urix = url . toNormalform ( true , false , ! localhost , false );
final String urix = url . toNormalform ( true , false );
final HttpGet httpGet = new HttpGet ( urix ) ;
if ( ! localhost ) setHost ( url . getHost ( ) ) ; // overwrite resolved IP, needed for shared web hosting DO NOT REMOVE, see http://en.wikipedia.org/wiki/Shared_web_hosting_service
return getContentBytes ( httpGet , maxBytes ) ;
@ -352,7 +352,7 @@ public class HTTPClient {
public void GET ( final String uri ) throws IOException {
if ( this . currentRequest ! = null ) throw new IOException ( "Client is in use!" ) ;
final MultiProtocolURI url = new MultiProtocolURI ( uri ) ;
final HttpGet httpGet = new HttpGet ( url . toNormalform ( true , false , true , false )) ;
final HttpGet httpGet = new HttpGet ( url . toNormalform ( true , false )) ;
setHost ( url . getHost ( ) ) ; // overwrite resolved IP, needed for shared web hosting DO NOT REMOVE, see http://en.wikipedia.org/wiki/Shared_web_hosting_service
this . currentRequest = httpGet ;
execute ( httpGet ) ;
@ -367,7 +367,7 @@ public class HTTPClient {
* /
public HttpResponse HEADResponse ( final String uri ) throws IOException {
final MultiProtocolURI url = new MultiProtocolURI ( uri ) ;
final HttpHead httpHead = new HttpHead ( url . toNormalform ( true , false , true , false )) ;
final HttpHead httpHead = new HttpHead ( url . toNormalform ( true , false )) ;
setHost ( url . getHost ( ) ) ; // overwrite resolved IP, needed for shared web hosting DO NOT REMOVE, see http://en.wikipedia.org/wiki/Shared_web_hosting_service
execute ( httpHead ) ;
finish ( ) ;
@ -388,7 +388,7 @@ public class HTTPClient {
public void POST ( final String uri , final InputStream instream , final long length ) throws IOException {
if ( this . currentRequest ! = null ) throw new IOException ( "Client is in use!" ) ;
final MultiProtocolURI url = new MultiProtocolURI ( uri ) ;
final HttpPost httpPost = new HttpPost ( url . toNormalform ( true , false , true , false )) ;
final HttpPost httpPost = new HttpPost ( url . toNormalform ( true , false )) ;
String host = url . getHost ( ) ;
if ( host = = null ) host = "127.0.0.1" ;
setHost ( host ) ; // overwrite resolved IP, needed for shared web hosting DO NOT REMOVE, see http://en.wikipedia.org/wiki/Shared_web_hosting_service
@ -424,7 +424,7 @@ public class HTTPClient {
* @throws IOException
* /
public byte [ ] POSTbytes ( final MultiProtocolURI url , final String vhost , final Map < String , ContentBody > post , final boolean usegzip ) throws IOException {
final HttpPost httpPost = new HttpPost ( url . toNormalform ( true , false , true , false )) ;
final HttpPost httpPost = new HttpPost ( url . toNormalform ( true , false )) ;
setHost ( vhost ) ; // overwrite resolved IP, needed for shared web hosting DO NOT REMOVE, see http://en.wikipedia.org/wiki/Shared_web_hosting_service
if ( vhost = = null ) setHost ( "127.0.0.1" ) ;
@ -455,7 +455,7 @@ public class HTTPClient {
* /
public byte [ ] POSTbytes ( final String uri , final InputStream instream , final long length ) throws IOException {
final MultiProtocolURI url = new MultiProtocolURI ( uri ) ;
final HttpPost httpPost = new HttpPost ( url . toNormalform ( true , false , true , false )) ;
final HttpPost httpPost = new HttpPost ( url . toNormalform ( true , false )) ;
String host = url . getHost ( ) ;
if ( host = = null ) host = "127.0.0.1" ;
setHost ( host ) ; // overwrite resolved IP, needed for shared web hosting DO NOT REMOVE, see http://en.wikipedia.org/wiki/Shared_web_hosting_service