Package pivot.web

Examples of pivot.web.BasicAuthentication.authenticate()


        // GET
        final GetQuery getQuery = new GetQuery(HOSTNAME, PORT, PATH, SECURE);
        getQuery.getArguments().put("a", "b");
        getQuery.setSerializer(new BinarySerializer());
        authentication.authenticate(getQuery);

        getQuery.execute(new TaskListener<Object>() {
            @SuppressWarnings("unchecked")
            public void taskExecuted(Task<Object> task) {
                Dictionary<String, Object> result = (Dictionary<String, Object>)task.getResult();
View Full Code Here


            }
        });

        // POST
        PostQuery postQuery = new PostQuery(HOSTNAME, PORT, PATH, SECURE);
        authentication.authenticate(postQuery);
        postQuery.setValue(JSONSerializer.parseList("[1, 2, 3]"));

        postQuery.execute(new TaskListener<URL>() {
            public void taskExecuted(Task<URL> task) {
                System.out.println("POST result: " + task.getResult());
View Full Code Here

            }
        });

        // PUT
        PutQuery putQuery = new PutQuery(HOSTNAME, PORT, PATH, SECURE);
        authentication.authenticate(putQuery);
        putQuery.setValue(JSONSerializer.parseMap("{a:100, b:200, c:300}"));

        putQuery.execute(new TaskListener<Void>() {
            public void taskExecuted(Task<Void> task) {
                System.out.println("PUT result");
View Full Code Here

            }
        });

        // POST
        DeleteQuery deleteQuery = new DeleteQuery(HOSTNAME, PORT, PATH, SECURE);
        authentication.authenticate(deleteQuery);

        deleteQuery.execute(new TaskListener<Void>() {
            public void taskExecuted(Task<Void> task) {
                System.out.println("DELETE result");
            }
View Full Code Here

        final GetQuery getQuery = new GetQuery(HOSTNAME, PORT, PATH, SECURE);
        getQuery.getParameters().put("a", "b");
        getQuery.setSerializer(new BinarySerializer());
        getQuery.getRequestHeaders().add("bar", "hello");
        getQuery.getRequestHeaders().add("bar", "world");
        authentication.authenticate(getQuery);

        getQuery.execute(new TaskListener<Object>() {
            @SuppressWarnings("unchecked")
            public void taskExecuted(Task<Object> task) {
                GetQuery getQuery = (GetQuery)task;
View Full Code Here

            }
        });

        // POST
        PostQuery postQuery = new PostQuery(HOSTNAME, PORT, PATH, SECURE);
        authentication.authenticate(postQuery);
        postQuery.setValue(JSONSerializer.parseList("[1, 2, 3]"));

        postQuery.execute(new TaskListener<URL>() {
            public void taskExecuted(Task<URL> task) {
                System.out.println("POST result: " + task.getResult());
View Full Code Here

            }
        });

        // PUT
        PutQuery putQuery = new PutQuery(HOSTNAME, PORT, PATH, SECURE);
        authentication.authenticate(putQuery);
        putQuery.setValue(JSONSerializer.parseMap("{a:100, b:200, c:300}"));

        putQuery.execute(new TaskListener<Void>() {
            public void taskExecuted(Task<Void> task) {
                System.out.println("PUT result");
View Full Code Here

            }
        });

        // POST
        DeleteQuery deleteQuery = new DeleteQuery(HOSTNAME, PORT, PATH, SECURE);
        authentication.authenticate(deleteQuery);

        deleteQuery.execute(new TaskListener<Void>() {
            public void taskExecuted(Task<Void> task) {
                System.out.println("DELETE result");
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.