Examples of cookie()


Examples of com.sun.jersey.api.client.WebResource.cookie()

    public static RestResponse get(String address, Map<String, Object> payload) {
        if (address.startsWith("/")) {
            address = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("REST_URL") + address;
        }
        WebResource webResource = JERSEY_CLIENT.resource(address).queryParams(buildMultivalueMap(payload));
        ClientResponse resp = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
                .accept(RESPONSE_TYPE).get(ClientResponse.class);
        return RestResponse.getRestResponse(resp);
    }
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

    }

    public static RestResponse post(String address, Map<String, Object> payload) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        MultivaluedMap formData = buildMultivalueMap(payload);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
//                .header("Content-type", MediaType.APPLICATION_FORM_URLENCODED)
                .accept(RESPONSE_TYPE).post(ClientResponse.class, formData);
        RestResponse rr = RestResponse.getRestResponse(cr);
        return rr;
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

    }

    public static RestResponse put(String address, Map<String, Object> payload) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        MultivaluedMap formData = buildMultivalueMap(payload);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
//                .header("Content-type", MediaType.APPLICATION_FORM_URLENCODED)
                .accept(RESPONSE_TYPE).put(ClientResponse.class, formData);
        RestResponse rr = RestResponse.getRestResponse(cr);
        return rr;
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

        return RestResponse.getRestResponse(cr);
    }

    public static RestResponse options(String address, String responseType) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
                .accept(responseType).options(ClientResponse.class);
        checkStatusForSuccess(cr);
        return RestResponse.getRestResponse(cr);
    }
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

            Client client2 = RestUtil.JERSEY_CLIENT;
            WebResource webResource = client2.resource(endpoint);
            String token = (String) session.getAttribute(AdminConsoleAuthModule.REST_TOKEN);
            MultivaluedMap formData = new MultivaluedMapImpl();
            formData.putSingle("id", slbFile);
            ClientResponse cr = webResource
                .cookie(new Cookie("gfresttoken", token))
                .accept(RestUtil.RESPONSE_TYPE).post(ClientResponse.class, formData);
            RestResponse rr = RestResponse.getRestResponse(cr);
            RestUtil.parseResponse(rr, null, endpoint, attrsMap, true, true);
      tmpFile = new FileInputStream(lbFile);
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

    public static RestResponse get(String address, Map<String, Object> payload) {
        if (address.startsWith("/")) {
            address = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("REST_URL") + address;
        }
        WebResource webResource = JERSEY_CLIENT.resource(address).queryParams(buildMultivalueMap(payload));
        ClientResponse resp = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
                .accept(RESPONSE_TYPE).get(ClientResponse.class);
        return RestResponse.getRestResponse(resp);
    }
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

    }

    public static RestResponse post(String address, Map<String, Object> payload) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        MultivaluedMap formData = buildMultivalueMap(payload);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
//                .header("Content-type", MediaType.APPLICATION_FORM_URLENCODED)
                .accept(RESPONSE_TYPE).post(ClientResponse.class, formData);
        RestResponse rr = RestResponse.getRestResponse(cr);
        return rr;
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

    }

    public static RestResponse put(String address, Map<String, Object> payload) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        MultivaluedMap formData = buildMultivalueMap(payload);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
//                .header("Content-type", MediaType.APPLICATION_FORM_URLENCODED)
                .accept(RESPONSE_TYPE).put(ClientResponse.class, formData);
        RestResponse rr = RestResponse.getRestResponse(cr);
        return rr;
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

        return RestResponse.getRestResponse(cr);
    }

    public static RestResponse options(String address, String responseType) {
        WebResource webResource = JERSEY_CLIENT.resource(address);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
                .accept(responseType).options(ClientResponse.class);
        checkStatusForSuccess(cr);
        return RestResponse.getRestResponse(cr);
    }
View Full Code Here

Examples of com.sun.jersey.api.client.WebResource.cookie()

    public static void postRestRequestFromServlet(HttpServletRequest request, String endpoint, Map<String, Object> attrs, boolean quiet, boolean throwException) {
        String token = (String) request.getSession().getAttribute(AdminConsoleAuthModule.REST_TOKEN);
        WebResource webResource = JERSEY_CLIENT.resource(endpoint);
        MultivaluedMap formData = buildMultivalueMap(attrs);
        ClientResponse cr = webResource
                .cookie(new Cookie(REST_TOKEN_COOKIE, token))
                .accept(RESPONSE_TYPE).post(ClientResponse.class, formData);
        RestResponse rr = RestResponse.getRestResponse(cr);
        parseResponse(rr, null, endpoint, attrs, quiet, throwException);
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.