Code example for DefaultHttpClient

Methods: getParams

0
    private MWApi api;
    private Account currentAccount = null; // Unlike a savings account...
    public static final String API_URL = "http://translatewiki.net/w/api.php";
    
    public static MWApi createMWApi() { 
        DefaultHttpClient client = new DefaultHttpClient();
        // Because WMF servers support only HTTP/1.0. Biggest difference that 
        // this makes is support for Chunked Transfer Encoding.  
        // I have this here so if any 1.1 features start being used, it  
        // throws up.  
        client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, 
                HttpVersion.HTTP_1_0);
        return new MWApi(API_URL, client);
    } 
     
    @Override 
    public void onCreate() { 
        // TODO Auto-generated method stub 
        super.onCreate(); 
        api = createMWApi();
        java.util.logging.Logger.getLogger("org.apache.http.wire").setLevel(java.util.logging.Level.INFO);