Package javax.ws.rs.core

Examples of javax.ws.rs.core.Form.param()


        /*
         * Add parameters as request body (form).
         */
        Form form = new Form();
        form.param(PARAM_NAME_EMPLOYEE_NAME, EMPLOYEE_NAME);
        form.param(PARAM_NAME_DATE_OF_BIRTH, EMPLOYEE_DATE_OF_BIRTH.toString());

        // e.g. http://localhost:8081/tes/resources/employee/create?name=Darth%20Vader
        final EmployeeEntity employeeResponse = resource.path("create").request(MediaType.APPLICATION_JSON)
                .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), EmployeeEntity.class);

View Full Code Here


        /*
         * Add parameters as request body (form).
         */
        Form form = new Form();
        form.param(PARAM_NAME_EMPLOYEE_NAME, EMPLOYEE_NAME);
        form.param(PARAM_NAME_DATE_OF_BIRTH, EMPLOYEE_DATE_OF_BIRTH.toString());

        // e.g. http://localhost:8081/tes/resources/employee/create?name=Darth%20Vader
        final JsonObject jsonObject = resource.path("create").request(MediaType.APPLICATION_JSON)
                .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), JsonObject.class);
View Full Code Here

        /*
         * Add parameters as request body (form).
         */
        Form form = new Form();
        form.param(PARAM_NAME_EMPLOYEE_NAME, EMPLOYEE_NAME);
        form.param(PARAM_NAME_DATE_OF_BIRTH, EMPLOYEE_DATE_OF_BIRTH.toString());

        // e.g. http://localhost:8081/tes/resources/employee/create?name=Darth%20Vader
        final JsonObject jsonObject = resource.path("create").request(MediaType.APPLICATION_JSON)
                .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), JsonObject.class);

View Full Code Here

        /*
         * Add parameters as request body (form).
         */
        Form form = new Form();
        form.param(PARAM_MANDATORY_NAME, PARAM_MANDATORY_VALUE);

        // e.g. http://localhost:8081/tes/resources/basic/echo
        final String response = resource.path("/echo").request(MediaType.TEXT_PLAIN)
                .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), String.class);

View Full Code Here

                        }
                        cookies.add(c);
                    } else if ((ann = anns.get((MatrixParam.class))) != null) {
                        newTarget = newTarget.matrixParam(((MatrixParam) ann).value(), value);
                    } else if ((ann = anns.get((FormParam.class))) != null) {
                        form.param(((FormParam) ann).value(), value.toString());
                    }
                }
            }
        }
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.