Search in sources :

Example 1 with ProxyHandle

use of com.androidquery.callback.ProxyHandle in project androidquery by androidquery.

the class AQueryAsyncTest method testAjaxProxyStaticNTLMCredential.

public void testAjaxProxyStaticNTLMCredential() throws ClientProtocolException, IOException {
    String url = "http://www.google.com";
    String proxyHost = "192.168.111.20";
    String domain = "AIGENSTEST.com";
    String user = "user3";
    String password = "Orange99";
    int port = 8081;
    //ProxyHandle handle = new BasicProxyHandle(host, port, user, password);
    ProxyHandle handle = new NTLMProxyHandle(proxyHost, port, domain, user, password);
    AjaxCallback.setProxyHandle(handle);
    aq.ajax(url, String.class, new AjaxCallback<String>() {

        @Override
        public void callback(String url, String json, AjaxStatus status) {
            done(url, json, status);
        }
    });
    waitAsync();
    assertNotNull(result);
}
Also used : ProxyHandle(com.androidquery.callback.ProxyHandle) AjaxStatus(com.androidquery.callback.AjaxStatus)

Example 2 with ProxyHandle

use of com.androidquery.callback.ProxyHandle in project androidquery by androidquery.

the class AQueryAsyncTest method testAjaxProxyStaticBasicCredential.

public void testAjaxProxyStaticBasicCredential() throws ClientProtocolException, IOException {
    String url = "http://www.google.com";
    String host = "192.168.1.6";
    int port = 8081;
    String user = "Peter";
    String password = "orange99";
    //AjaxCallback.setProxy(host, port, user, password);
    ProxyHandle handle = new BasicProxyHandle(host, port, user, password);
    AjaxCallback.setProxyHandle(handle);
    aq.ajax(url, String.class, new AjaxCallback<String>() {

        @Override
        public void callback(String url, String json, AjaxStatus status) {
            done(url, json, status);
        }
    });
    waitAsync();
    assertNotNull(result);
}
Also used : ProxyHandle(com.androidquery.callback.ProxyHandle) AjaxStatus(com.androidquery.callback.AjaxStatus)

Aggregations

AjaxStatus (com.androidquery.callback.AjaxStatus)2 ProxyHandle (com.androidquery.callback.ProxyHandle)2