Examples of RequestEntity


Examples of org.apache.commons.httpclient.methods.RequestEntity

            checkConsumed();
            if (value == null) {
                // setting property value to 'null' is identical to a removal
                remove(propertyId);
            } else {
                RequestEntity ent = getEntity(value);
                String uri = getItemUri(propertyId, sessionInfo);
                // TODO: use PUT in order to avoid the ValuesProperty-PROPPATCH call.
                // TODO: actually not quite correct for PROPPATCH assert that prop really exists.
                PutMethod method = new PutMethod(uri);
                method.setRequestHeader(HEADER_CONTENT_TYPE, JcrValueType.contentTypeFromType(value.getType()));
View Full Code Here

Examples of org.apache.commons.httpclient.methods.RequestEntity

        private RequestEntity getEntity(QValue value) throws RepositoryException {
            // SPI value must be converted to jcr value
            InputStream in;
            int type = value.getType();
            String contentType = JcrValueType.contentTypeFromType(type);
            RequestEntity ent;
            try {
                switch (type) {
                    case PropertyType.NAME:
                    case PropertyType.PATH:
                        String str = ValueFormat.getJCRString(value, resolver);
View Full Code Here

Examples of org.apache.commons.httpclient.methods.RequestEntity

        out.setHeader("http.responseCode", responseCode);
    }

    protected HttpMethod createMethod(Exchange exchange) {
        String uri = getEndpoint().getEndpointUri();
        RequestEntity requestEntity = createRequestEntity(exchange);
        if (requestEntity == null) {
            return new GetMethod(uri);
        }
        // TODO we might be PUT? - have some better way to explicitly choose
        // method
View Full Code Here

Examples of org.springframework.http.RequestEntity

  }

  @Test
  @SuppressWarnings("rawtypes")
  public void testBindingExceptionForMachineClient() throws Exception {
    RequestEntity request = RequestEntity
        .get(URI.create("http://localhost:" + this.port + "/bind"))
        .accept(MediaType.APPLICATION_JSON).build();
    ResponseEntity<Map> entity = new TestRestTemplate().exchange(request, Map.class);
    String resp = entity.getBody().toString();
    assertThat(resp, containsString("Error count: 1"));
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.