Package org.apache.commons.httpclient.methods

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


       
        String ct = "multipart/form-data; boundary=bqJky99mlBWa-ZuqjC53mG6EzbmlxB";
        post.setRequestHeader("Content-Type", ct);
        InputStream is =
            getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/" + resourceName);
        RequestEntity entity = new InputStreamRequestEntity(is);
        post.setRequestEntity(entity);
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
View Full Code Here


    PostMethod httppost = new PostMethod("http://localhost:8080/httpclienttest/body");

    File file = new File(args[0]);

    httppost.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(file)));
    httppost.setContentChunked(true);

    try {
        client.executeMethod(httppost);
View Full Code Here

        // from the input stream
        // Per default, the request content needs to be buffered
        // in order to determine its length.
        // Request body buffering can be avoided when
        // content length is explicitly specified
        post.setRequestEntity(new InputStreamRequestEntity(
            new FileInputStream(input), input.length()));
        // Specify content type and encoding
        // If content encoding is not explicitly specified
        // ISO-8859-1 is assumed
        post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
View Full Code Here

    HttpClient client = new HttpClient();

    PostMethod httppost = new PostMethod("http://localhost:8080/httpclienttest/body");

    File file = new File(args[0]);
    httppost.setRequestEntity(new InputStreamRequestEntity(
        new FileInputStream(file), file.length()));

    try {
        client.executeMethod(httppost);
View Full Code Here

  public ClientResponse post(
    String uri,
    InputStream in,
    RequestOptions options) {
      return execute("POST", uri, new InputStreamRequestEntity(in), options);
  }
View Full Code Here

  public ClientResponse put(
    String uri,
    InputStream in,
    RequestOptions options) {
      return execute("PUT", uri, new InputStreamRequestEntity(in), options);
  }
View Full Code Here

                        String str = ValueFormat.getJCRString(value, resolver);
                        ent = new StringRequestEntity(str, contentType, "UTF-8");
                        break;
                    case PropertyType.BINARY:
                        in = value.getStream();
                        ent = new InputStreamRequestEntity(in, contentType);
                        break;
                    default:
                        str = value.getString();
                        ent = new StringRequestEntity(str, contentType, "UTF-8");
                        break;
View Full Code Here

        // TODO: improve. currently random name is built instead of retrieving name of new resource from top-level xml element within stream
        Name nodeName = getNameFactory().create(Name.NS_DEFAULT_URI, UUID.randomUUID().toString());
        String uri = getItemUri(parentId, nodeName, sessionInfo);
        MkColMethod method = new MkColMethod(uri);
        method.addRequestHeader(ItemResourceConstants.IMPORT_UUID_BEHAVIOR, Integer.toString(uuidBehaviour));
        method.setRequestEntity(new InputStreamRequestEntity(xmlStream, "text/xml"));
        execute(method, sessionInfo);
    }
View Full Code Here

        container.activateComponent(http, "http1");

        container.start();

        PostMethod method = new PostMethod("http://localhost:8193/ep2/");
        method.setRequestEntity(new InputStreamRequestEntity(getClass().getResourceAsStream("soap-request-12.xml")));
        int state = new HttpClient().executeMethod(method);
        assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, state);
        SourceTransformer st = new SourceTransformer();
        Node node = st.toDOMNode(new StreamSource(method.getResponseBodyAsStream()));
        logger.info(st.toString(node));
View Full Code Here

        container.activateComponent(http, "http1");

        container.start();

        PostMethod method = new PostMethod("http://localhost:8194/ep2/");
        method.setRequestEntity(new InputStreamRequestEntity(getClass().getResourceAsStream("soap-request.xml")));
        int state = new HttpClient().executeMethod(method);
        String str = method.getResponseBodyAsString();
        logger.info(str);
        assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, state);
        SourceTransformer st = new SourceTransformer();
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.methods.InputStreamRequestEntity

Copyright © 2018 www.massapicom. 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.