Package org.jboss.resteasy.client

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


      Assert.assertEquals(response, "Hello Bill");
      response = request.postTarget(String.class);
      System.out.println(response);
      Assert.assertEquals(response, "Hello Bill");
      request.clear();
      request.body("text/plain", "Goodbye ").pathParameter("name", "Everyone");
      response = request.postTarget(String.class);
      System.out.println(response);
      Assert.assertEquals(response, "Goodbye Everyone");

View Full Code Here


      customer.setState("MA");
      customer.setZip("01711");
      customer.setCountry("USA");

      request = new ClientRequest(customers.getHref());
      request.body("application/xml", customer);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());

      Link orders = shoppingLinks.get("orders");
View Full Code Here

      order.getLineItems().add(item);

      System.out.println();
      System.out.println("** Create an order through this URL: " + orders.getHref());
      request = new ClientRequest(orders.getHref());
      request.body("application/xml", order);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());
      String createdOrderUrl = (String) response.getHeaders().getFirst("Location");

      System.out.println();
View Full Code Here

      DKIMSignature contentSignature = new DKIMSignature();
      contentSignature.setDomain("samplezone.org");
      contentSignature.setSelector("test");
      contentSignature.setPrivateKey(keys.getPrivate());
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());


   }
View Full Code Here

      contentSignature.setDomain("samplezone.org");
      contentSignature.setSelector("test");
      contentSignature.setAttribute("code", "hello");
      contentSignature.setPrivateKey(keys.getPrivate());
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());


   }
View Full Code Here

      contentSignature.setSelector("test");
      contentSignature.setDomain("samplezone.org");
      request.getAttributes().put(KeyRepository.class.getName(), repository);

      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());


   }
View Full Code Here

      DKIMSignature contentSignature = new DKIMSignature();
      contentSignature.setSelector("test");
      contentSignature.setDomain("samplezone.org");
      contentSignature.setPrivateKey(badKey);
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(401, response.getStatus());
   }

   @Test
View Full Code Here

   @Test
   public void testBasicVerificationNoSignature() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/signed"));
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(401, response.getStatus());
   }

   @Test
View Full Code Here

      Assert.assertEquals(200, response.getStatus());
      System.out.println(response.getEntity());
      response.releaseConnection();

      request = new ClientRequest(generateURL("/array"));
      request.body("application/json", "[{\"foo\":{\"@test\":\"bill{\"}},{\"foo\":{\"@test\":\"monica\\\"}\"}}]");
      response = request.post(String.class);
      Assert.assertEquals(200, response.getStatus());
      response.releaseConnection();

   }
View Full Code Here

      System.out.println(response.getEntity());
      String entity = response.getEntity();

      System.out.println("HERE 2");
      request = new ClientRequest(generateURL("/list"));
      request.body("application/json", entity);
      response = request.post(String.class);
      Assert.assertEquals(200, response.getStatus());
      System.out.println("There");

   }
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.