Examples of formParameter()


Examples of org.jboss.resteasy.client.ClientRequest.formParameter()

         request.formParameter(BOOLEAN_VALUE_FIELD, "true");
         request.formParameter(NAME_FIELD, "This is My Name");
         request.formParameter(DOUBLE_VALUE_FIELD, "123.45");
         request.formParameter(LONG_VALUE_FIELD, "566780");
         request.formParameter(INTEGER_VALUE_FIELD, "3");
         request.formParameter(SHORT_VALUE_FIELD, "12345");
         ClientResponse<InputStream> response = request.post(InputStream.class);
         Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatus());
         String contentType = response.getResponseHeaders().getFirst("content-type");
         Assert.assertEquals("application/x-www-form-urlencoded", contentType);
         InputStream responseStream = response.getEntity();
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.formParameter()

   //@Test
   public void testQueryParamIsNull()
   {
      ClientRequest request = new ClientRequest(generateURL("/simple"));
      request.formParameter("hello", "world");
      try
      {
         ClientResponse<String> response = request.post(String.class);
         Assert.assertEquals(HttpResponseCodes.SC_OK, response.getStatus());
         Assert.assertEquals("hello=world", response.getEntity());
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.formParameter()

   //@Test
   public void testPost()
   {
      ClientRequest request = new ClientRequest(generateURL("/form"));
      request.formParameter("hello", "world");
      try
      {
         ClientResponse<String> response = request.post(String.class);
         Assert.assertEquals(HttpResponseCodes.SC_OK, response.getStatus());
         Assert.assertEquals("hello=world", response.getEntity());
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.formParameter()

   //@Test
   public void testPostTwoParameters()
   {
      ClientRequest request = new ClientRequest(generateURL("/form/twoparams"));
      request.formParameter("hello", "world");
      request.formParameter("yo", "mama");
      try
      {
         ClientResponse<String> response = request.post(String.class);
         Assert.assertEquals(HttpResponseCodes.SC_OK, response.getStatus());
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.formParameter()

   //@Test
   public void testPostTwoParameters()
   {
      ClientRequest request = new ClientRequest(generateURL("/form/twoparams"));
      request.formParameter("hello", "world");
      request.formParameter("yo", "mama");
      try
      {
         ClientResponse<String> response = request.post(String.class);
         Assert.assertEquals(HttpResponseCodes.SC_OK, response.getStatus());
         String body = response.getEntity();
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.formParameter()

        ApacheHttpClient4Executor executor = ResourceAdminManager.createExecutor();


        try {
            ClientRequest request = executor.createRequest(adminUrl);
            request.formParameter(GeneralConstants.SAML_REQUEST_KEY, logoutRequestString);
            request.formParameter(SAML2LogOutHandler.BACK_CHANNEL_LOGOUT, SAML2LogOutHandler.BACK_CHANNEL_LOGOUT);
            ClientResponse response = null;
            try {
                response = request.post();
                response.releaseConnection();
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.formParameter()


        try {
            ClientRequest request = executor.createRequest(adminUrl);
            request.formParameter(GeneralConstants.SAML_REQUEST_KEY, logoutRequestString);
            request.formParameter(SAML2LogOutHandler.BACK_CHANNEL_LOGOUT, SAML2LogOutHandler.BACK_CHANNEL_LOGOUT);
            ClientResponse response = null;
            try {
                response = request.post();
                response.releaseConnection();
                // Undertow will redirect root urls not ending in "/" to root url + "/".  Test for this weird behavior
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.formParameter()

                if (response.getStatus() == 302  && !adminUrl.endsWith("/")) {
                    String redirect = (String)response.getHeaders().getFirst(HttpHeaders.LOCATION);
                    String withSlash = adminUrl + "/";
                    if (withSlash.equals(redirect)) {
                        request = executor.createRequest(withSlash);
                        request.formParameter(GeneralConstants.SAML_REQUEST_KEY, logoutRequestString);
                        request.formParameter(SAML2LogOutHandler.BACK_CHANNEL_LOGOUT, SAML2LogOutHandler.BACK_CHANNEL_LOGOUT);
                        response = request.post();
                        response.releaseConnection();
                    }
                }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.formParameter()

                    String redirect = (String)response.getHeaders().getFirst(HttpHeaders.LOCATION);
                    String withSlash = adminUrl + "/";
                    if (withSlash.equals(redirect)) {
                        request = executor.createRequest(withSlash);
                        request.formParameter(GeneralConstants.SAML_REQUEST_KEY, logoutRequestString);
                        request.formParameter(SAML2LogOutHandler.BACK_CHANNEL_LOGOUT, SAML2LogOutHandler.BACK_CHANNEL_LOGOUT);
                        response = request.post();
                        response.releaseConnection();
                    }
                }
            } catch (Exception e) {
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.